位置:首頁 > 數據庫 > SQL教學 > SQL CEIL()函數

SQL CEIL()函數

CEIL(X)

CEILING(X)

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

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

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