PostgreSQL ABS Function

Education is not limited to just classrooms. It can be gained anytime, anywhere... - Ravi Ranjan (M.Tech-NIT)

PostgreSQL ABS() function

ABS() function

The PostgreSQL abs() is used to return the absolute value of a number passed as an argument.

Syntax :

abs()

PostgreSQL Version : 9.3

Example : PostgreSQL ABS() function

SELECT ABS(115.36) AS "Absolute Value";

Output :

 Absolute Value
----------------
         115.36
(1 row)

Example : PostgreSQL ABS() function using negative value

SELECT  ABS(-115.36) AS "Absolute Value";

Output :

 Absolute Value
----------------
         115.36
(1 row)