RosettaCodeData/Task/Conditional-structures/SQL/conditional-structures-1.sql
Ingy döt Net d066446780 langs a-z
2013-04-10 22:43:41 -07:00

9 lines
220 B
Transact-SQL

case when a then b else c end
declare @n int
set @n=124
print case when @n=123 then 'equal' else 'not equal' end
--If/ElseIf expression
set @n=5
print case when @n=3 then 'Three' when @n=4 then 'Four' else 'Other' end