Order of Operations
Operator precedence is the order in which an operator is run.
In SQL, the operator precedence is as follows:
- Parentheses
- Multiplication or division
- Addition or subtraction
- NOT
- AND
- OR
A + B * CPerforms
B * C
and then adds
A to the result.
(A + B) * C
Performs
A + B first and then multiply the result by
C.