This tutorial explains how to use the MySQL SIGN function with syntax and examples.
The MySQL SIGN function returns a value indicating the sign of a number.
The syntax for the SIGN function in MySQL is:
SIGN( number )
The number to test for its sign.
The SIGN function can be used in the following versions of MySQL:
Let's look at some MySQL SIGN function examples and explore how to use the SIGN function in MySQL.
For example:
mysql> SELECT SIGN(12);
Output: 1
mysql> SELECT SIGN(0);
Output: 0
mysql> SELECT SIGN(-12);
Output: -1