UNARY_MINUS()
All functions > MATH > UNARY_MINUS()
Negates a numeric expression (unary minus).
Signatures
Returns: Same type as the operand
UNARY_MINUS(expr: T) → T sql
| Parameter | Type | Required | Description |
|---|---|---|---|
expr | T | Yes | Operand |
With:
T: Any numeric type
Notes
- Written in FeatureQL as a leading
-before an expression (for example-AMOUNT). - NULL in, NULL out.
Examples
FeatureQL
SELECT
f1 := UNARY_MINUS(3), -- Function call form
f2 := -3, -- Operator form on integer literal
f3 := -1.0E0 -- DOUBLE literal
;Result
| f1 BIGINT | f2 BIGINT | f3 VARCHAR |
|---|---|---|
| -3 | -3 | -1.0 |
On this page