Is it possible to make a CASE statement attibuting the same label to a WHEN result using ‘OR’?
Something like:
CASE
WHEN name = John OR name = Mary THEN ‘family’
ELSE ‘friend’
END
FROM table;
Is it possible to make a CASE statement attibuting the same label to a WHEN result using ‘OR’?
Something like:
CASE
WHEN name = John OR name = Mary THEN ‘family’
ELSE ‘friend’
END
FROM table;
Seems its possible to use in
keyword:
https://stackoverflow.com/questions/2120133/can-the-sql-case-statement-fall-through
Some programming languages do support the feature you ask for, general is called/name: case fall through. So something like mysql case fall through
is worth googling if you want to do some more research
Actually that sintaxe can be done. I tried on the exercise and it worked. Thanks for your answer.
I will try the way you suggested.