当前位置: 代码迷 >> 报表 >> sql保留小数有关问题
  详细解决方案

sql保留小数有关问题

热度:180   发布时间:2016-05-05 07:30:50.0
sql保留小数问题
select case  when cast(no7 as numeric(10,2))<>0 then round(cast(no5 as float)/cast(no7 as float),2) else 0.00 end yll from ...怎么让结果一直显示为两位小数
------解决方案--------------------
CAST(列名 AS  decimal(18,2))  或者 CONVERT(decimal(18,2),列名)
  相关解决方案