Important
New database features are no longer connected to engine versions; features are now enabled independently during scheduled update windows, and “major” and “minor” releases no longer exist in Helios. Please visit the release notes to view the latest features available in your database clusters.
ABS
On this page
The ABS() function returns the positive value of a given number, regardless of sign.
Syntax
ABS ( expression )
Arguments
-
expression: any expression.
This may be a column name, the result of another function, or a math operation.
Return Type
The absolute value of the expression.
Examples
SELECT ABS(-9);
+---------+
| ABS(-9) |
+---------+
| 9 |
+---------+SELECT ABS(9);
+--------+
| ABS(9) |
+--------+
| 9 |
+--------+SELECT ABS(20-50);
+------------+
| ABS(20-50) |
+------------+
| 30 |
+------------+Last modified: