Important

Helios features are now enabled during weekly update windows and are no longer directly tied to SingleStore engine releases. Refer to the release notes to view the latest features available in your Helios cluster.

SIGN

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:

Was this article helpful?