simple example from the web:
CASE search_expression WHEN expression1 THEN result1 WHEN expression2 THEN result2 ... WHEN expressionN THEN resultN ELSE default_result END
But what if have want to combine expression1 and expression 2 to give me the same result?
CASE some_number WHEN 1, 3, 7 THEN result1 WHEN 2 THEN result2 ... END
My CASE cannot have BETWEEN because it is either 1 or 3 or 7.
CASE some_number WHEN 1 OR 3 OR 7 THEN result1 WHEN 2 THEN result2 ... END
and I tried:
CASE some_number WHEN some_number = 1 OR some_number = 3 OR some_number = 7 THEN result1 WHEN 2 THEN result2 ... END
That all have me en error (Missing keyword)
I know I can do:
CASE some_number WHEN 1 THEN result1 WHEN 3 THEN result1 WHEN 7 THEN result1 WHEN 2 THEN result2 ... END
But this way I would repeat result1, but that's ugly coding.
I cannot find the example of combining several expressions in CASE WHEN statement, that should be possible