What is ABS() in SQL?
The ABS() function returns the absolute value of a number.
Figure 1 shows a mathematical representation of the ABS() function.
Syntax
ABS(number)
Parameter
The ABS() function takes a number as a parameter.
Return value
The ABS() function returns the absolute value of a number that is passed in as a parameter.
Code
-- negative numberSELECT ABS(-10);-- 0SELECT ABS(0);-- positive numberSELECT ABS(10);