|previous : next|
This is experimental functionality, and as such subject to change. Use at your own risk!
Applies to ✅ Open Source Edition ✅ Express Edition ✅ Professional Edition ✅ Enterprise Edition
When a searched CASE expression nests another
CASE expression in its
ELSE clause, that can be flattened into the top level
CASE expression. This does not affect the simple
Using Settings.transformPatternsFlattenCase, the following transformations can be achieved:
-- With Settings.transformPatternsFlattenCase active, this: SELECT CASE WHEN a = b THEN 1 ELSE CASE WHEN c = d THEN 2 END END FROM tab; -- ... is transformed into the equivalent expression: SELECT CASE WHEN a = b THEN 1 WHEN c = d THEN 2 END FROM tab;
Do you have any feedback about this page? We'd love to hear it!