Mysql之取整函数 博客分类: DB
程序员文章站
2024-02-25 23:39:33
...
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 | +-------------+--------------+--------------+