當前位置:首頁 » MySQL » MySQL CEIL()/CEILING()函數

MySQL CEIL()/CEILING()函數

MySQL CEIL()/CEILING()函數用法實例代碼教學

CEIL(X)

CEILING(X)

這些函數返回的最小整數的值不小於X的請看下麵的例子:

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)