MULTIPLY()

All functions > MATH > MULTIPLY()

Returns the product of two numbers, or scales an interval by an integer factor.

Signatures

Numeric multiplication

Returns: Product of the two numbers

MULTIPLY(number1: T, number2: T) → T
sql
ParameterTypeRequiredDescription
number1TYesFirst number to multiply
number2TYesSecond number to multiply

With:

  • T : Any numeric type

Signature notes:

  • Both arguments must be of the same numeric type
  • Returns NULL if either operand is NULL
  • Multiplication is commutative: a * b = b * a

Related operators

Examples

MULTIPLY(...)

FeatureQL
SELECT
    -- Function call
    f1 := MULTIPLY(3, 4)
;
Result
f1 BIGINT
12

.MULTIPLY(...) — chained

FeatureQL
SELECT
    -- Integer literal: parenthesize for `.MULTIPLY` on BIGINT
    f1 := (3).MULTIPLY(4),
    -- Decimal base: chain without extra parentheses
    f2 := 1.5.MULTIPLY(3)
;
Result
f1 BIGINTf2 VARCHAR
124.5

Interval scaling

FeatureQL
SELECT
    -- Scale a day interval
    f1 := INTERVAL_PARSE('1 day') * 3,
    -- Integer on the left side
    f2 := 5 * INTERVAL_PARSE('2 hours'),
    -- Compose sub-hour intervals
    f3 := INTERVAL_PARSE('15 minutes') * 4,
    -- Zero factor yields zero interval
    f4 := INTERVAL_PARSE('1 hour') * 0
;
Result
f1 VARCHARf2 VARCHARf3 VARCHARf4 VARCHAR
3 days 00:00:000 days 10:00:000 days 01:00:000 days 00:00:00

Edge cases

FeatureQL
SELECT
    -- Negative factor
    f1 := MULTIPLY(-5, 2),
    -- Multiplication by zero
    f2 := MULTIPLY(0, 100),
    -- DECIMAL × DECIMAL
    f3 := MULTIPLY(1.5, 3.0),
    -- DOUBLE × DOUBLE
    f4 := MULTIPLY(1.5e0, 3.0e0)
;
Result
f1 BIGINTf2 BIGINTf3 VARCHARf4 VARCHAR
-1004.54.5

Last update at: 2026/06/20 10:08:10