mirror of
https://github.com/jbranchaud/til
synced 2026-01-03 23:28:02 +00:00
507 B
507 B
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)