Operator precedence is the order in which an operator is executed.
In SQL the operator precedence is as follows:
- Parentheses
- Multiplication or division
- Addition or subtraction
- NOT
- AND
- OR
Parentheses can be used to override these rules of precedence as shown in the following example:
A + B * C
Performs
B * C
and then adds
A to the result.
Performs
A + B first and then multiply the result by
C.
Copyright © Cloud Software Group, Inc. All rights reserved.