O'Reilly logo

Adobe ColdFusion 8 Web Application Construction Kit, Volume 1: Getting Started by Charlie Arehart, Raymond Camden, Ben Forta

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Evaluation Precedence

When a WHERE clause is processed, the operators are evaluated in the following order of precedence:

  • Parentheses have the highest precedence.

  • The AND operator has the next level of precedence.

  • The OR operator has the lowest level of precedence.

What does this mean? Well, look at the WHERE clause in Listing 6.9. The clause reads WHERE FirstName='Ben' AND LastName='Forta' OR FirstName='Rick' AND LastName='Richards'. AND is evaluated before OR so this statement looks for Ben Forta and Rick Richards, which is what we wanted.

But what would be returned by a WHERE clause of WHERE FirstName='Rick' OR FirstName='Ben' AND LastName= 'Forta'? Does that statement mean anyone whose first name is either Rick or Ben, and whose last name ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required