Suppose I have this statement:
SELECT * FROM MyTable WHERE a = 1 or b = 2 and c = 3
Does that mean: (a = 1) OR (b = 2 AND c = 3) or does it mean (a = 1 or b = 2) AND c = 3? Can I change what it means, i.e. execute the OR before the AND or is this not possible?
From Technet:
So yes, it means
(a = 1) OR (b = 2 AND c = 3).You can force the behavior you want by writing the parentheses as you did above:
(a = 1 OR b = 2) AND c = 3