Re: [SQL] Order of precedence between AND and OR.

2005-11-25 Thread Tom Lane
David Pradier <[EMAIL PROTECTED]> writes: > But what I couldn't find is if there is an order of precedence between > AND and OR, that is if the AND expression is calculated before the OR > one, or anyelse way. AND first; see http://www.postgresql.org/docs/8.1/static/sql-syntax.html#SQL-PRECEDENCE

[SQL] Order of precedence between AND and OR.

2005-11-25 Thread David Pradier
Hi everybody, during the code inspection due to our migration to 8.1, I found a piece of SQL code written like this : WHERE a AND b OR c AND d Now, I know that AND and OR are commutative because it's written in the docs. But what I couldn't find is if there is an order of precedence between AND