标签:mysql函数
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)
其中ceil为向上取整,round为四舍五入取整,floor为向下取整。
本文出自 “Chocolee” 博客,请务必保留此出处http://chocolee.blog.51cto.com/8158455/1550344
标签:mysql函数
原文地址:http://chocolee.blog.51cto.com/8158455/1550344