当前位置: 首页 > 工具软件 > sign > 使用案例 >

mysql sign_MySQL sign()函数

岳英锐
2023-12-01

SIGN(X)

这个函数返回X的符号(负数,零或正)对应-1,0或1。

mysql>SELECT SIGN(-4.65); +---------------------------------------------------------+ | SIGN(-4.65) | +---------------------------------------------------------+ | -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(4.65); +---------------------------------------------------------+ | SIGN(4.65) | +---------------------------------------------------------+ | 1 | +---------------------------------------------------------+ 1 row in set (0.00 sec)

¥ 我要打赏 纠错/补充 收藏

 类似资料: