|previous : next|
This is experimental functionality, and as such subject to change. Use at your own risk!
Unnecessary ORDER BY expressions
Applies to ✅ Open Source Edition ✅ Express Edition ✅ Professional Edition ✅ Enterprise Edition
When an expression is repeated in the ORDER BY clause, then the second one can be removed as it has no effect - even if it has a different value for
Using Settings.transformPatternsUnnecessaryOrderByExpressions, the following transformations can be achieved:
-- With Settings.transformPatternsUnnecessaryOrderByExpressions active, this: SELECT a, b FROM t ORDER BY a DESC, b, a ASC; -- ... is transformed into the equivalent expression: SELECT a, b FROM t GROUP BY a DESC, b;
Do you have any feedback about this page? We'd love to hear it!