Mysql Operator precedence

What is operator precedence in mysql?

Explanation

MySQL 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.
OperatorsDescription
1() [] -> . ::Grouping, scope, array / member access
2! ~ - + * & sizeof type cast ++x --x (most) unary operations, sizeof and type casts
3* / %Multiplication, division, modulo
4+ -Addition and subtraction
5<< >>Bitwise shift left and right
6< <= > >=Comparisons: less-than, ...
7== !=Comparisons: equal and not equal
8&Bitwise AND
9^Bitwise exclusive OR
10|Bitwise inclusive (normal) OR
11&&Logical AND
12||Logical OR
13?: = += -= *= /= %= &= |= ^= <<= >>=Conditional expression (ternary) and assignment operators
14,Comma operator

If a statement contains paranthesis, then the operations inside the paranthesis are performed first. These operators will be explained in the following sections.
The above description shows the MySQL Operator Precedence.

Ask Questions

Ask Question