Hello
It's a bit puzzling to get a multiple WHERE criteria to work in the right order.
My query is:
WHERE [1] = "Y"
AND [2] NOT IN ("a","b")
AND [3] IN ("a","b","c")
AND (([4] IN ("a","b")
OR [4] IS NULL
OR [4] LIKE "A%")
AND [5] NOT IN ("a"))
OR ([4]="a"
AND [5]="a")
Basically, the WHERE and the next two AND will need to always be evaluated.
Then, in addition, I want to return:
([4] IN ("a","b") OR [4] IS NULL OR [4] LIKE "A%" AND [5] NOT IN ("a"))
OR
([4]="a" AND [5]="a")
However, I get results where [4] is not "a" AND [5]="a")
Any idea?