following sql is just meaning - wrong in syntax:
select * from ... where user_id <> 10 and (name='hello' or name='good');
brace above makes "or" has higher priority than "and" - similar to 5x(2+3) in math.
do I have to write user_id <> 10 for twice in real sql as bellow?
select * from ... where user_id <> 10 and name='hello' or user_id <> 10 and name='good';
Any comments to make the sql simpler?
Thanks


Reply With Quote
Bookmarks