AllExperts > Experts 
Search      

Database Programming

Volunteer
Answers to thousands of questions
 Home · More Questions · Answer Library  · Encyclopedia ·
More Database Programming Answers
Question Library

Ask a question about Database Programming
Volunteer
Experts of the Month
Expert Login

Awards

About Us
Tell friends
Link to Us
Disclaimer

 
 
 
 
About Marty Landman
Expertise
Database installation, analysis & design and programming questions.

Experience
Have done application programming as well as some installation and administration mostly with MySQL for web servers and site development and also with IMS and DB2 on legacy systems in the past.

Education/Credentials
MS in computer science.

 
   

You are here:  Experts > Industry > Data Management > Database Programming > SQL

Topic: Database Programming



Expert: Marty Landman
Date: 5/30/2007
Subject: SQL

Question
Hello there, I am studying IT and have an exam and I know I should know this but I have only just found out there is an order to the operators!  Can you help?
what is the correct order of SQL operators?
a) OR, AND, NOT, =
b) =, NOT, AND, OR
c=, >, <, <=, >=
d>=, <=, <, >, =

Answer
Look at http://dev.mysql.com/doc/refman/5.0/en/operator-precedence.html and you'll see

12.2.1. Operator Precedence

Operator precedences are shown in the following list, from lowest precedence to the highest. Operators that are shown together on a line have the same precedence.

:=
||, OR, XOR
&&, AND
NOT
BETWEEN, CASE, WHEN, THEN, ELSE
=, <=>, >=, >, <=, <, <>, !=, IS, LIKE, REGEXP, IN
|
&
<<, >>
-, +
*, /, DIV, %, MOD
^
- (unary minus), ~ (unary bit inversion)
!
BINARY, COLLATE


Marty Landman
http://www.face2interface.com/

Add to this Answer    Ask a Question



  Rate this Answer
   Was this answer helpful?
Not at allDefinitely              
   12345  

     
About Us | Advertise on This Site | User Agreement | Privacy Policy | Help
Copyright  © 2008 About, Inc. About and About.com are registered trademarks of About, Inc. The About logo is a trademark of About, Inc. All rights reserved.