i need in SQL the equivalent C# code for
int caseSwitch = 1;
switch (caseSwitch)
{
case 1:
case 2:
case 3:
case 4:
Console.WriteLine("x");
break;
default:
Console.WriteLine("Default case");
break;
}
i have multiple conditions and same result
and i don’t want to write all code
case when cond1 then result1
when cond2 then result1
when cond3 then result1
....
end
any ideas ?
thanks
Something like this:
In a table select. It would be something like this: