比较int和返回1
问题描述:
我试图比较这些2场,比较int和返回1
select(@[email protected]@[email protected]),@var6
,并在我的脑海,我有这样的事情
if (@[email protected]@[email protected])>@var6
then return 1
else return 0
我如何在SQL这样做呢?
答
Select case when (@[email protected]@[email protected])>@var6 then 1 else 0 end
+0
谢谢约翰! – taby
+0
@taby不用担心。我们都时不时被阻止:) –
这些变量是int类型的,它们之前已被声明和设置。 – taby