Two formats of case expression are as follows:
Refer to this video to learn CASE EXPRESSION in detail:
You can use CASE with many WHEN like this;
CASE WHEN Col1 = 1 OR Col3 = 1 THEN 1
WHEN Col1 = 2 THEN 2
...
ELSE 0 END as Qty
The Simple CASE expression can be written like this:
CASE Col1 WHEN 1 THEN 11 WHEN 2 THEN 21 ELSE 13 END
Or else you can use CASE within CASE this way;
CASE WHEN Col1 < 2 THEN
CASE Col2 WHEN 'X' THEN 10 ELSE 11 END
WHEN Col1 = 2 THEN 2
...
ELSE 0 END as Qty