ABS Function

Returns the absolute value of a numeric value expression.

Category: Mathematical
Returned data type: The same data type as the expression

Syntax

Arguments

expression

specifies any valid SQL expression that evaluates to a numeric value.

Type BIGINT, DOUBLE, FLOAT, INTEGER, REAL, SMALLINT, TINYINT
See <sql-expression>
FedSQL Expressions

Details

If expression is null, then the ABS function returns null. If the result is a number that does not fit into the range of the argument's data type, the ABS function fails.

Example

The following statements illustrate the ABS function:
Statements
Results
select abs(-345);
345
select abs((3 * 50) / 5)
30
Last updated: February 23, 2017