四舍五入,有两种格式哦
ROUND(X)
四舍五入返回整数
SELECT ROUND(-1.23); # -1 SELECT ROUND(-1.58); # -2 SELECT ROUND(1.58); # 2
ROUND(X,D)
SELECT ROUND(1.298, 1); # 1.3 SELECT ROUND(1.298, 0); # 1 SELECT ROUND(23.298, -1); # 20 SELECT ROUND(.12345678901234567890123456789012345, 35); # 0.123456789012345678901234567890