其中ceil为向上取整,round为四舍五入取整,floor为向下取整。
mysql> select ceil(2.44),round(2.44),floor(2.44);
+————+————-+————-+
| ceil(2.44) | round(2.44) | floor(2.44) |
+————+————-+————-+
| 3 | 2 | 2 |
+————+————-+————-+
1 row in set (0.00 sec)
mysql> select ceil(2.55),round(2.55),floor(2.55);
+————+————-+————-+
| ceil(2.55) | round(2.55) | floor(2.55) |
+————+————-+————-+
| 3 | 3 | 2 |
+————+————-+————-+
1 row in set (0.00 sec)