Skip to main content

Categories: Math

ABS

Computes the absolute value of a numeric expression. The return type matches the input type. Returns NULL if the input is NULL.

Syntax​

ABS(numeric_expression NUMERIC) → NUMERIC​

  • numeric_expression: The numeric value to compute the absolute value for.

Examples

ABS example
SELECT ABS(0.0)
-- 0.0
ABS example
SELECT ABS(-2)
-- 2
ABS example
SELECT ABS(NULL)
-- null