select case A when B then '正常' else '错误' end from [Table]
CREATE FUNCTION dbo.F_Test( @A int, @B int) RETURNS varchar(100) AS BEGINreturn (Select case when @A<>@B then '错误' else '正常' end)ENDSelect dbo.F_Test(100,300)------ 错误
select case then A<>B then 'false' else 'true' end
declare @A int declare @B intset @A= 100 set @B = 200 select case @A when @B then '正常' else '错误' end
else '正常'
end
RETURNS varchar(100) AS
BEGINreturn (Select case when @A<>@B then '错误' else '正常' end)ENDSelect dbo.F_Test(100,300)------
错误
declare @B intset @A= 100
set @B = 200
select case @A when @B then '正常' else '错误' end