Skip to main content

Arithmetic operators

Arithmetic operators are used to generate numeric output from one or more input expressions.

The input expressions must be numeric (integer or floating point), except in the following cases:

  • The binary operator + and - can be applied for datetime calculations:
    • <timestamp>+<interval> returns a <timestamp>
    • <timestamp>-<interval> returns a <timestamp>
    • <timestamp>-<timestamp> returns a <interval>

List of arithmetic operators

OperatorSyntaxDescription
+a + bAdds two numeric expressions (a and b).
- (unary)-aNegates the input numeric expression.
*-aMultiplies two numeric expressions (a and b).
/a / bDivides one numeric expression (a) by another (b). Divide by 0 returns infinity.