Tenzin Tenzin - 1 month ago 12
SQL Question

Opposite of the ABS function

I know that with

ABS()
you can convert negative numbers to positive numbers.

But with what function do you convert a positive number to a negative number?

Is there even any?

Answer
-ABS(x)

e.g.

select -abs(123),-abs(-123)

-abs(123) -abs(-123) 
--------- ---------- 
-123      -123