ADD
All functions > MATH > ADD
Returns the sum of two quantities, numbers, dates/timestamps or intervals.
Signatures
Numeric addition
Returns: Sum of the two numbers
ADD(number1: T, number2: T) → T sql
| Parameter | Type | Required | Description |
|---|---|---|---|
number1 | T | Yes | First number to add |
number2 | T | Yes | Second number to add |
With:
T: Any numeric type
Signature notes:
- Both arguments must be of the same numeric type
- Returns NULL if either operand is NULL
- Can be chained:
(1).ADD(2).ADD(3) - Operator form:
number1 + number2 - Overflow behavior depends on the underlying SQL engine
See also
Examples
Numeric addition
FeatureQL
SELECT
f1 := ADD(1, 2), -- Basic integer addition
f2 := ADD(1.0, 2.0), -- Basic decimal addition
f3 := ADD(1e0, 2e0), -- Basic float addition with precision
f4 := (1).ADD(2), -- Method syntax
f5 := (1).ADD(2).ADD(3), -- Chained method calls
f6 := 1 + 2 -- Operator syntax
;Result
| f1 BIGINT | f2 VARCHAR | f3 VARCHAR | f4 BIGINT | f5 BIGINT | f6 BIGINT |
|---|---|---|---|---|---|
| 3 | 3.0 | 3.0 | 3 | 6 | 3 |