Introduction

Arithmetic operators can perform arithmetical operations on numeric operands involved. Arithmetic operators are

  • Addition (+)
  • Subtraction (-)
  • Multiplication (*)
  • Division (/)
  • Modulo (%)

Operator Precedence

A statement having multiple operators is evaluated based on the priority of operators. If all the operators have equal precedence, then the operators are evaluated from left to right. Operators with different precedence are evaluated from highest to lowest. Following list shows the operators with their precedence from high to low as you go from top to bottom. Operators having same precedence are placed in the same row.

  • Parenthesis
  • Division, Multiplication
  • Addition, Subtraction
  • NOT
  • AND
  • ALL, ANY, BETWEEN, IN, LIKE, OR

Reference

SQL Arithmetic Operators