ABS
This section contains reference documentation for the abs function.
Last updated
Was this helpful?
This section contains reference documentation for the abs function.
Absolute value of a number. This is a polymorphic function that preserves the input numeric type.
ABS(col1)
col1
INT, LONG, FLOAT, DOUBLE, BIG_DECIMAL
Value to get absolute
Returns the same type as the input argument.
select ABS(-12.1) AS value
from ignoreMe12.1
select ABS(12.1) AS value
from ignoreMe12.1
select ABS(-42) AS int_abs, ABS(-1000000L) AS long_abs, ABS(-3.14F) AS float_abs, ABS(-2.718) AS double_abs
from myTableReturns INT, LONG, FLOAT, DOUBLE respectively (preserving input type).
Last updated
Was this helpful?
Was this helpful?

