Skip to 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>
OperatorSyntaxDescription
- (unary)-aNegates the input numeric expression.
+a + bAdds two numeric expressions (a and b).
-a - bSubtracts one numeric expression (b) from another (a).
*a * bMultiplies two numeric expressions (a and b).
/a / bDivides one numeric expression (a) by another (b). Divide by 0 returns infinity.
%a % bComputes the modulo of numeric expression a by b.
ScopeDB Logo ScopeDB
© 2025 ScopeDB. All rights reserved.