mysql.h
SIGN
SIGN(X)
Devuelve el signo del argumento como -1, 0 ó 1, dependiendo de si X es negativo, cero o positivo:
mysql> SELECT SIGN(-32); +-----------+ | SIGN(-32) | +-----------+ | -1 | +-----------+ 1 row in set (0.00 sec) mysql> SELECT SIGN(0); +---------+ | SIGN(0) | +---------+ | 0 | +---------+ 1 row in set (0.00 sec) mysql> SELECT SIGN(234); +-----------+ | SIGN(234) | +-----------+ | 1 | +-----------+ 1 row in set (0.00 sec)