Operator precedences : Operator « Introduction « MySQL Tutorial






Operator precedences are shown in the following list, from lowest precedence to the highest.

Operators that are shown together on a line have the same precedence.

  1. :=
  2. ||, OR, XOR
  3. &&, AND
  4. NOT
  5. BETWEEN, CASE, WHEN, THEN, ELSE
  6. =, <=>, >=, >, <=, <, <>, !=, IS, LIKE, REGEXP, IN
  7. |
  8. &
  9. <<, >>
  10. -, +
  11. *, /, DIV, %, MOD
  12. ^
  13. - (unary minus), ~ (unary bit inversion)
  14. !
  15. BINARY, COLLATE
1.4.Operator
1.4.1.Operator
1.4.2.Operator precedences
1.4.3.To override this order and group terms explicitly, use parentheses.