除法不会自动保留小数
select 8/(100-3) as c1,
round(8/(100-3) ,4) as c2,
round(8/(100-3)::numeric ,4) as c3,
8/(100-3)::numeric as c4;
-[结果 ]--------------
c1 | 0
c2 | 0.0000
c3 | 0.0825
c4 | 0.08247422680412371134
除法不会自动保留小数
select 8/(100-3) as c1,
round(8/(100-3) ,4) as c2,
round(8/(100-3)::numeric ,4) as c3,
8/(100-3)::numeric as c4;
-[结果 ]--------------
c1 | 0
c2 | 0.0000
c3 | 0.0825
c4 | 0.08247422680412371134