sql parenthetical expression examples 1

sql parenthetical expression examples

SELECT * FROM ihtags
WHERE (tagname LIKE '*001*' AND description LIKE '*sim*') OR
(tagname LIKE '*02*' AND (description LIKE '*sec*' OR description LIKE '*sim*'))

Here is what the above code is Doing:
1. The first part of the query is looking for tagname that contains 001 and description that contains sim.
2. The second part of the query is looking for tagname that contains 02 and description that contains sec or sim.
3. The OR operator is used to combine the two parts of the query.

Similar Posts