Mysql CEIL和FLOOR的用法

mysql> select CEIL(1.2);
+-----------+
| CEIL(1.2) |
+-----------+
|         2 |
+-----------+
1 row in set (0.00 sec)

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

mysql> SELECT FLOOR(1.2);
+------------+
| FLOOR(1.2) |
+------------+
|          1 |
+------------+
1 row in set (0.00 sec)

mysql> SELECT FLOOR(-1.2);
+-------------+
| FLOOR(-1.2) |
+-------------+
|          -2 |
+-------------+
1 row in set (0.00 sec)

 

posted on 2020-09-12 06:48  shenggong  阅读(372)  评论(0编辑  收藏  举报

导航