Dwa sposoby wykorzystania CASE w tym scenariuszu z MSSQL
DECLARE
@test int,
@result char(10)
SET @test = 10
SET @result = CASE @test
WHEN 10 THEN
'OK test'
ELSE
'Test is not OK'
END
PRINT @result;
SET @result = CASE
WHEN @test = 10 THEN
'OK test'
ELSE
'Test is not OK'
END
PRINT @result