Jump to: navigation, search

Mysql SIGN

From w3cyberlearnings

Contents

MySQL SIGN Function

This function returns the sign of the argument. Negative is (-), Zero is (0), and Positive is (+).

Syntax SIGN

X is a number.

SIGN(X);

Example 1

mysql> SELECT SIGN(-30),SIGN(30), SIGN(0);
+-----------+----------+---------+
| SIGN(-30) | SIGN(30) | SIGN(0) |
+-----------+----------+---------+
|        -1 |        1 |       0 |
+-----------+----------+---------+
1 row in set (0.00 sec)


Related Links


Navigation
Web
SQL
MISC
References