Operator Order of Precedence
The below table shows order of operations for all operators, from highest to lowest precedence.
| Operator | Associativity | Description |
|---|---|---|
() | Parentheses | |
. | Left | Member Access |
[] | Left | Array Index |
- | Right | Negation |
COLLATE | Left | Collation |
^ | Right | Exponentiation |
*, /, % | Left | Multiplication, Division, Modulo |
+, - | Left | Addition, Subtraction |
| any other expression | Left | any other expression |
IN | Set Membership | |
LIKE, ILIKE | Pattern Matching | |
BETWEEN | Range Comparison | |
==, !=, =, >, <, >=, <= | Comparison | |
IS | Type Comparison | |
NOT | Right | Logical NOT |
AND | Left | Logical AND |
OR | Left | Logical OR |