Description
The ABS( ) function returns returns the absolute value of a number.
This function has the form:
SELECT ABS(number)
Parameter | Description |
---|---|
number | (required) A number |
Return Value
The absolute value of number.
Examples
The following example shows the basic use of this function.
mysql> SELECT ABS(10);
-> 10
mysql> SELECT ABS(-10);
-> 10