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.
SIGN
On this page
This function returns 1 if the argument is positive, -1 if it is negative, and 0 if it is 0.
Syntax
SIGN ( expression )
Arguments
-
expression: any valid numeric expression.
Return Type
Integer.
Examples
SELECT SIGN(6), SIGN(-6), SIGN(0);
+---------+----------+---------+
| SIGN(6) | SIGN(-6) | SIGN(0) |
+---------+----------+---------+
| 1 | -1 | 0 |
+---------+----------+---------+
Last modified: February 24, 2023