Important
Self-managed SingleStore will soon transition from version 9.1 RC to version 10. This new semantic versioning scheme will provide SingleStore with finer control over engine and feature releases that were not possible with the current versioning scheme.
In the interim, SingleStore 9.1 RC can be used to preview, evaluate, and provide feedback on the new and upcoming features in SingleStore 10 prior to its general availability. Ahead of this transition, SingleStore 9.0 is recommended for production workloads, which can later be upgraded to SingleStore 10.
SIGN
On this page
The SIGN() 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: