Let's say I have the following table:
uid
bonus
revenue
and I want to do the following:
SELECT all those uids except those that have bonus=5 AND revenues=0.
Thus, anyone with 0 revenue but bonus other than 5, is good. Anyone with revenue > 0 is good.
My query I had was this:
SELECT uid FROM table WHERE (revenues > 0 OR bonus > 0) AND (bonus !=5 AND revenues=0);
This only returns me rows having revenue=0 and bonus !=5. I thought the brackets would force it to do "except those that have bonus=5 AND revenues=0", but apparently not.
Any help on the proper way to formulate my query so it works ???
Thx in advance.