钱为零时排除

时间:2013-08-22 15:38:29

标签: tsql syntax ssms

当钱为零时,我需要排除查询中的情况。我已经尝试了一切:

money <> 0.00
money != 0.00
money <> 0
money != 0
cast (money as int) <> 0
cast (money as int) != 0
cast (money as varchar) <> ''
cast (money as varchar) != ''

当钱为零时,他们都没有捕捉到的情况。有什么想法吗?

1 个答案:

答案 0 :(得分:0)

我最好猜测你需要什么:

Case when money = 0 then '' else money end

更多阅读:http://technet.microsoft.com/en-us/library/ms181765.aspx