Mysql之取整函数

Mysq的两个取整函数:

ceil():向上取整

floor():向下取整

round():四舍五入

mysql> select ceil(10/11),floor(10/11),round(10/20);
+-------------+--------------+--------------+
| ceil(10/11) | floor(10/11) | round(10/20) |
+-------------+--------------+--------------+
|           1 |            0 |            1 |
+-------------+--------------+--------------+

猜你喜欢

转载自snv.iteye.com/blog/2386992