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
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
  • 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 BIGINTf2 VARCHARf3 VARCHARf4 BIGINTf5 BIGINTf6 BIGINT
33.03.0363

Last update at: 2026/03/03 16:47:38
Last updated: 2026-03-03 16:48:19