Does anyone here know the significant difference of single CASE statement with many WHEN against multiple CASE statements?
eg.
SELECT
blah
, CASE WHEN x THEN 'abc'
WHEN y THEN 'deF'
WHEN z THEN 'gHi'
ELSE END
, CASE WHEN x THEN 'abc' ELSE
CASE WHEN y THEN 'deF' ELSE
CASE WHEN z THEN 'gHi' ELSE
END
END
END
.
Thanks in advance for the insights!
Not fully sure of what you want to hear but… Multiple
WHENclauses exist so you don’t need to nestCASEstatements.Edit:
To clarify things: both constructs can do the same things, but nested CASEs makes code more messy and unreadable. A similar example: