Available in versions: (可用版本:) Dev (3.21) | Latest (最新) (3.20) | 3.19 | 3.18

GROUP BY <列索引>

适用于 ❌ 开源版   ✅ Express 版   ✅ 专业版   ✅ 企业版

A lot of dialects support (许多方言支持) GROUP BY <column index> where the (1 based) column index references a column from the (其中基于 1 的列索引引用自) SELECT clause (SELECT 子句) (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

示例配置

Settings settings = new Settings()
    .setTransformGroupByColumnIndex(Transformation.WHEN_NEEDED);

引用此页

反馈

Do you have any feedback about this page? (您对此页面有任何反馈吗?) We'd love to hear it! (我们很乐意听到!)

The jOOQ Logo