This ABS() function returns absolute value of a number, for example, the absolute value of 5 is 5, and the absolute value of -5 is also 5. In Mathematics, absolute value can be think of as a distance from zero.

ABS function examples


SELECT ABS(-15) FROM DUAL; -- 15

SELECT ABS(-51.321) FROM DUAL; --51.321

SELECT ABS(-20+12) FROM DUAL; -- 8

SELECT ABS(-5*6) FROM DUAL; -- 30

SELECT ABS(12/-3) FROM DUAL; -- 4

References

  1. ABS Function :- Oracle official docs
  2. Wikipedia – Absolute value