+ [addition]
All functions > MATH > + [addition]
Adds two numeric values, or adds an interval to a date or timestamp.
Syntax
left + right · ADD(left, right)
Notes
- Numeric addition requires compatible numeric types; returns NULL if either operand is NULL
- You can add an INTERVAL to a DATE or TIMESTAMP (and the symmetric interval-first form where the grammar allows it)
- Very large finite magnitudes can overflow when using floating-point types
Related Functions
Examples
+ — numeric
FeatureQL
SELECT
f1 := 1 + 2, -- Basic addition
f2 := 10 + (-3) -- Right-hand side in parentheses
;Result
| f1 BIGINT | f2 BIGINT |
|---|---|
| 3 | 7 |
+ — date and time
FeatureQL
SELECT
f1 := TIMESTAMP '2021-01-01' + INTERVAL '1 DAY' -- Timestamp plus interval
;Result
| f1 TIMESTAMP |
|---|
| 2021-01-02T00:00:00 |
+ — floating-point
FeatureQL
SELECT
f1 := 1.5E0 + 2.5E0 -- DOUBLE operands
;Result
| f1 VARCHAR |
|---|
| 4.0 |