Do you have a question? Post it now! No Registration Necessary. Now with pictures!
May 12, 2006, 12:13 am
rate this thread
statement, where "AND" and "OR" are mixed in, and there are no parentheses.
WHERE a=1 and b=2 or c=3
How would that be "parenthesized" internally in MySQL? What is the rule for
precedence between and and or? Thanks IKe
Re: No parens in where clause
AND has higher precedence than OR.
WHERE (a=1 AND b=2) OR c=3
FWIW, this is the same boolean operator precedence as in virtually any
other programming language you care to mention.
See also http://dev.mysql.com/doc/refman/5.0/en/operator-precedence.html
- » Americanas.com SALDO de TVs Com at 80% de Desconto (29798)
- — Newest thread in » MySQL Database Forum