Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

AND OR precedence

Status
Not open for further replies.

filure

Technical User
Jun 30, 2003
3
FR
Hello,

in the query :

SELECT ...
FROM ...
WHERE X
AND
Y
OR
Z

How is evaluated the filter?

(X AND Y) OR Z ?
X AND (Y OR Z) ?

What is the precedence?

Thank u.
 
I believe it is AND first and then OR. But I would use parens to make it clear to anyone reading the code what conditions should be ORed
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top