ABS()

All functions > MATH > ABS()

Returns the absolute value of a number.

Signatures

Absolute value

Returns: The absolute (non-negative) value

ABS(number: T) → T
sql
ParameterTypeRequiredDescription
numberTYesThe number to take the absolute value of

With:

  • T : Any numeric type

Signature notes:

  • Preserves the input type
  • Returns NULL if the input is NULL
  • ABS(0) = 0

Examples

FeatureQL
SELECT
    f1 := ABS(-10), -- Negative integer
    f2 := ABS(5), -- Positive integer
    f3 := ABS(0), -- Zero
    f4 := ABS(-3.7E0) -- Negative decimal
;
Result
f1 BIGINTf2 BIGINTf3 BIGINTf4 VARCHAR
10503.7

Last update at: 2026/05/26 17:22:09