四舍五入:round()
select 100/6 as 四舍五入前结果 :16.6667 select round(100/6) as四舍五入后结果 :17
进一法:ceiling()
select 100/6 as 进一前结果 :16.6667 select ceiling(100/6) as 进一后结果 :17
保留两位小数:case(计算公式 as decimal(20,2))
select 100/5 as 不保留小数 :20.0000 select cast(100/5 as decimal(20,2)) as 保留两位小数结果 :20.00