1、round(x,d) ,x指要处理的数,d是指保留几位小数
2、round(x) ,其实就是round(x,0),也就是默认d为0;
同时,round()函数中还能附带其他函数,如:sum(),avg(),count()…
例如
select e.date ,round(
avg(case e.type when'completed' then 0 else 1 end),3)
from email e
where e.send_id not in (select id from user where is_blacklist = 1)
and receive_id not in (select id from user where is_blacklist = 1)
group by e.date