|
Operator Precedence:
Operators are used to operate with two operands. Wide collection of Operators are
available in MySQL. The operator precedences are shown below in the table.
| Highest Precedence | := |
1 | ||, OR, XOR |
2 | &&, AND |
3 | BETWEEN, CASE, WHEN, THEN, ELSE |
4 | =, <=>, >=, >, <=, <, <>, !=, IS, LIKE, REGEXP, IN |
5 | | |
6 | & |
7 | <<, >> |
8 | -, + |
9 | *, /, DIV, %, MOD |
10 | ^ |
11 | - (unary minus), ~ (unary bit inversion) |
12 | !, NOT |
Lowest | BINARY, COLLATE |
If a statement contains paranthesis, then the operations inside the paranthesis are performed first. These operators will be explained in the following sections.
|