Oracle ABS Function: Get Absolute Value in SQL
The ABS function in Oracle database is a numeric function used to return the absolute value of a given number. It calculates the absolute value of a specified number, converting negative numbers to positive while leaving positive numbers unchanged.
Here is the syntax for the ABS function:
ABS(number)
- number: A number or expression for which the absolute value needs to be calculated.
For example, when we call ABS(-10), the ABS function will return 10 because the absolute value of -10 is 10. The ABS function is very useful for handling negative numbers in numerical calculations to ensure accurate results.