Skip to content

Latest commit

 

History

History
26 lines (21 loc) · 507 Bytes

shorthand-absolute-value-operator.md

File metadata and controls

26 lines (21 loc) · 507 Bytes

Shorthand Absolute Value Operator

Postgres offers many math functions including abs for computing the absolute value of a number.

> select abs(-1);
 abs
-----
   1
(1 row)

There is also an absolute value operator -- the @ symbol. This can be used to do the same thing.

> select @ -1;
 ?column?
----------
        1
(1 row)

source