Thursday, January 10, 2013

SQL Abs Function


In Oracle/PLSQL, the abs function returns the absolute value of a number.

Syntax

The syntax for the abs function is:
abs( number )
number is the number to convert to an absolute value.

Applies To

  • Oracle 11g, Oracle 10g, Oracle 9i, Oracle 8i

For Example

abs(-23)would return 23
abs(-23.6)would return 23.6
abs(-23.65)would return 23.65
abs(23.65)would return 23.65
abs(23.65 * -1)would return 23.65