* [multiplication]
All functions > MATH > *** [multiplication]**
Returns the product of two numbers, or scales an interval by an integer factor.
Syntax
left * right · MULTIPLY(left, right)
Notes
- Both operands must be compatible numeric types, or one must be INTERVAL and the other an integer
- When scaling an interval, either order is accepted:
interval * norn * interval - Returns NULL if either operand is NULL
- Multiplication is commutative
- Very large finite magnitudes can overflow when using floating-point types
Related Functions
Examples
* — numeric
FeatureQL
SELECT
-- Basic multiplication
f1 := 3 * 4,
-- Negative left operand
f2 := -5 * 2
;Result
| f1 BIGINT | f2 BIGINT |
|---|---|
| 12 | -10 |
* — 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')
;Result
| f1 VARCHAR | f2 VARCHAR |
|---|---|
| 3 days 00:00:00 | 0 days 10:00:00 |
* — floating-point
FeatureQL
SELECT
-- DOUBLE operands
f1 := 1.5e0 * 3.0e0
;Result
| f1 VARCHAR |
|---|
| 4.5 |