1.select Convert(decimal(18,2),2.)
结果:2.18
2.select CAST(2. as decimal(18,2))
结果:2.18
3.select Round(2.,2)
结果:2.

4.Oracle中,利用sql语句中的函数实现:
select trunc(1.,2)
round(m,n) 四舍五入
trunc(m,n) 不四舍五入,直接丢弃。
发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/205664.html原文链接:https://javaforall.net
