1.select Convert(decimal(18,2),2.176544)
结果:2.18
2.select CAST(2.176544 as decimal(18,2))
结果:2.18
3.select Round(2.176544,2)
结果:2.180000
4.Oracle中,利用sql语句中的函数实现:
select trunc(1.23856789,2)
round(m,n) 四舍五入
trunc(m,n) 不四舍五入,直接丢弃。
1.select Convert(decimal(18,2),2.176544)
结果:2.18
2.select CAST(2.176544 as decimal(18,2))
结果:2.18
3.select Round(2.176544,2)
结果:2.180000
4.Oracle中,利用sql语句中的函数实现:
select trunc(1.23856789,2)
round(m,n) 四舍五入
trunc(m,n) 不四舍五入,直接丢弃。