select
sal as '原始数据',
round(sal) as '四舍五入后的数据' ,
round(sal,1) as '四舍五入1个小数点后的数据',
round(sal,-1) as '四舍五入-1个小数点后的数据'
from
emp;
# 生成100以内额随机整数 select round(rand()*100) from emp;
select
sal as '原始数据',
round(sal) as '四舍五入后的数据' ,
round(sal,1) as '四舍五入1个小数点后的数据',
round(sal,-1) as '四舍五入-1个小数点后的数据'
from
emp;
# 生成100以内额随机整数 select round(rand()*100) from emp;