select round(123.456, 0) from dual; 返回123select round(123.456, 1) from dual; 返回123.5
select round(-123.456, 2) from dual; 返回-123.46
2.ceil和floor函数
ceil和floor函数在一些业务数据的时候,有时还是很有用的。ceil(n) 取大于等于数值n的最小整数;floor(n)取小于等于数值n的最大整数
select ceil(1.5) a from dual; 返回2select ceil(-1.5) a from dual; 返回-1select floor(1.5) a from dual; 返回1select floor(-1.5) a from dual; 返回-2