ABS
Warning
SingleStore 9.0 gives you the opportunity to preview, evaluate, and provide feedback on new and upcoming features prior to their general availability. In the interim, SingleStore 8.9 is recommended for production workloads, which can later be upgraded to SingleStore 9.0.
On this page
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: April 17, 2023