Product Documentation

SQL Reference Guide

Previous Topic

Next Topic

ABS function (ODBC compatible)

Syntax

ABS ( expression )

Description

The scalar function ABS computes the absolute value of expression.

Example

SELECT ABS (MONTHS_BETWEEN (SYSDATE, order_date))

FROM orders

WHERE ABS (MONTHS_BETWEEN (SYSDATE, order_date)) > 3 ;

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.

TOCIndex