View Single Post
Old 12-01-2012, 07:50 AM   PM User | #2
Old Pedant
Supreme Master coder!

 
Old Pedant's Avatar
 
Join Date: Feb 2009
Posts: 23,200
Thanks: 59
Thanked 3,996 Times in 3,965 Posts
Old Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to all
Too general a question. Depends entirely upon what the WHERE condition is supposed to be testing.

Code:
WHERE age >= 18 OR age >= 16 AND parentalConsent = True
There is an AND condition at the end with no parentheses at all, yet the meaning is perfectly clear:

It means the same as
Code:
WHERE age >= 18 OR ( age >= 16 AND parentalConsent = True )
*clearly* it would be a mistake to use
Code:
WHERE ( age >= 18 OR age >= 16 ) AND parentalConsent = True
When in doubt, probably use them. But use them correctly.
__________________
An optimist sees the glass as half full.
A pessimist sees the glass as half empty.
A realist drinks it no matter how much there is.
Old Pedant is offline   Reply With Quote
Users who have thanked Old Pedant for this post:
sonny (12-01-2012)