GROUP BY <column index>
Applies to ❌ Open Source Edition ✅ Express Edition ✅ Professional Edition ✅ Enterprise Edition
A lot of dialects support GROUP BY <column index> where the (1 based) column index references a column from the SELECT clause (if it is an expression that does not contain an aggregate or window function).
This transformation allows for transforming some of these syntaxes to equivalent, standard syntax by repeating the expression:
-- Input SELECT t.col FROM t GROUP BY 1
-- Output SELECT t.col FROM t GROUP BY t.col
Example configuration
Settings settings = new Settings() .setTransformGroupByColumnIndex(Transformation.WHEN_NEEDED);
Feedback
Do you have any feedback about this page? We'd love to hear it!