当前位置:Gxlcms > mysql > mysql向上取整函数ceil()/ceiling()

mysql向上取整函数ceil()/ceiling()

时间:2021-07-01 10:21:17 帮助过:245人阅读

ceil() /ceiling()使用实例:

mysql> SELECT CEILING(3.46);
+---------------------------------------------------------+
| CEILING(3.46)                                           |
+---------------------------------------------------------+
| 4                                                       |
+---------------------------------------------------------+
1 row in set (0.00 sec)

mysql> SELECT CEIL(-6.43);
+---------------------------------------------------------+
| CEIL(-6.43)                                             |
+---------------------------------------------------------+
| -6                                                      |
+---------------------------------------------------------+
1 row in set (0.00 sec)

注意:该函数是向上取整,返回的是大于x的最小整数值。注意负数值的情况。

人气教程排行