ADD()

All functions > MATH > ADD()

Returns the sum of two numbers, or adds an interval to a date/timestamp.

Signatures

Numeric addition

Returns: Sum of the two numbers

ADD(number1: T, number2: T) → T
sql
ParameterTypeRequiredDescription
number1TYesFirst number to add
number2TYesSecond 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
  • Very large finite magnitudes can overflow when using floating-point types

Related operators

Examples

ADD(...)

FeatureQL
SELECT
    f1 := ADD(1, 2) -- Function call
;
Result
f1 BIGINT
3

.ADD(...) — chained

FeatureQL
SELECT
    f1 := (1).ADD(2), -- Integer literal: wrap in parentheses so `.ADD` applies to the value, not to the digit sequence
    f2 := 1.0.ADD(2), -- Decimal base: chain without extra parentheses
    f3 := (1).ADD(2).ADD(3) -- Fold left via chained `.ADD`
;
Result
f1 BIGINTf2 VARCHARf3 BIGINT
33.06

Date and time

FeatureQL
SELECT
    f1 := TIMESTAMP '2021-01-01'.ADD(INTERVAL '1 DAY'), -- Chained add on a timestamp
    f2 := TIMESTAMP '2025-09-01 12:00:00'.ADD(INTERVAL_PARSE('2 hours 30 minutes')) -- Parsed duration
;
Result
f1 TIMESTAMPf2 TIMESTAMP
2021-01-02T00:00:002025-09-01T14:30:00

Edge cases

FeatureQL
SELECT
    f1 := ADD(1.0, 2.0), -- DECIMAL addition
    f2 := ADD(1E0, 2E0), -- DOUBLE addition
    f3 := ADD(10, -3) -- Negative right operand
;
Result
f1 VARCHARf2 VARCHARf3 BIGINT
3.03.07

Last update at: 2026/05/26 17:22:09