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
-- Function call form
f1 := UNARY_MINUS(3),
-- Operator form on integer literal
f2 := -3,
-- DOUBLE literal
f3 := -1.0e0
;Result
| f1 BIGINT | f2 BIGINT | f3 VARCHAR |
|---|---|---|
| -3 | -3 | -1.0 |
On this page