Expression precedence Precedence of operations from highest to lowest is as follows. Expressionshierarchy ofprecedence of
  • (), ?, constants (including sign), NULL, columnReference, scalarSubquery, CAST
  • LENGTH, CURRENT_DATE, CURRENT_TIME, CURRENT_TIMESTAMP, and other built-ins
  • Unary + and -
  • *, /, || (concatenation)
  • Binary + and -
  • Comparisons, quantified comparisons, EXISTS, IN, IS NULL, LIKE, BETWEEN, IS
  • NOT
  • AND
  • OR

You can explicitly specify precedence by placing expressions within parentheses. An expression within parentheses is evaluated before any operations outside the parentheses are applied to it.

Example (3+4)*9 (age < 16 OR age > 65) AND employed = TRUE