I am trying to compare these 2 fields,
select(@var1-@var2-@var3-@var4),@var6
and in my mind, I have something like this
if (@var1-@var2-@var3-@var4)>@var6
then return 1
else return 0
How can I do this in SQL?
答案 0 :(得分:1)
Select case when (@var1-@var2-@var3-@var4)>@var6 then 1 else 0 end