Skip to content
Pivot is in early development and is not production ready. See Project status.

Arithmetic

Pivot supports binary arithmetic on numeric expressions and limited interval arithmetic on dates and timestamps.

Operator Result
Addition Sum of two values.
Subtraction Difference between two values.
Multiplication Product of two values.
Division Floating-point quotient.
left_value + right_value

Adds two numeric values.

SELECT range + 2 AS result FROM range(1, 2);
-- result: 3
left_value - right_value

Subtracts the right numeric value from the left.

SELECT range - 2 AS result FROM range(5, 6);
-- result: 3
left_value * right_value

Multiplies two numeric values.

SELECT range * 3 AS result FROM range(2, 3);
-- result: 6
left_value / right_value

Returns a floating-point quotient. Dividing two REAL values returns REAL; other numeric pairs use DOUBLE.

SELECT range / 2 AS result FROM range(5, 6);
-- result: 2.5

A DATE or TIMESTAMP can be adjusted by a constant INTERVAL.

SELECT ts + INTERVAL '1 hour' AS later
FROM (VALUES (TIMESTAMP '2026-09-09 12:00:00')) AS input(ts);
-- later: 2026-09-09 13:00:00

Month and year offsets are not supported. A DATE accepts only whole-day offsets.