Computes the absolute value of expression.

Syntax

ABS ( expression )

Notes

  • The argument to the function must be of type TINYINT, SMALLINT, INTEGER, NUMERIC, REAL, or FLOAT.
  • The result is of type NUMERIC.
  • If the argument expression evaluates to NULL, the result is NULL.

Example

This example illustrates the ABS function:

SELECT ABS (MONTHS_BETWEEN (SYSDATE, order_date)) 
    FROM orders
    WHERE  ABS (MONTHS_BETWEEN (SYSDATE, order_date)) > 3 ;

Compatibility

ODBC compatible