2 ms·
Yea this is a common problem with contrived code samples like these. In my experience the author is right in that real world examples of using CASE can often ge
by rco8786 4y ago
Yea this is a common problem with contrived code samples like these. In my experience the author is right in that real world examples of using CASE can often get out of hand - especially if you need it in more than one place. But the contrived, simple example is clearly easier than the CTE.
It is perhaps not surprising that we end up with this sort of stuff in production code, because the original author only needed one simple CASE statement and then it organically grew from there.