正确写法:
SELECT [Km_ID]
,[科目]
, convert(decimal(20,2),
case when ([支行] IS NULL) or [支行]='' then '0.00'
else replace([支行],',','')
end
)
,[月份]
FROM [icbcFinancial].[dbo].[vi_tmpchengben]
错误写法
SELECT [Km_ID]
,[科目]
, convert(decimal(20,2),
case when ([支行] IS NULL) or [支行]='' then 0.00
else replace([支行],',','')
end
)
,[月份]
FROM [icbcFinancial].[dbo].[vi_tmpchengben]
能看出区别吗?