Skip to content

ordinal-number-group-by (QY001)#

Automatic fix is not available.

What it does#

Checks that GROUP BY does not use numeric ordinals (e.g., GROUP BY 1).

Why not?#

Using ordinals reduces readability, makes queries fragile when the SELECT list changes, and obscures intent.

When should you?#

Almost never.

Use instead:#

Explicit column names or expressions.