SQL

SQL

Made by DeepSource

Unidiomatic SELECT operand arrangement SQL-L034

Style
Minor

Arrange SELECTs in the order of

  • wildcards
  • then, simple named targets,
  • then, calculations and aggregates.

Bad practice

SELECT
    a,
    *,
    row_number() OVER (partition BY id ORDER BY date) AS y,
    b
FROM x

Recommended

SELECT
    *,
    a,
    b,
    row_number() OVER (partition BY id ORDER BY date) AS y,
FROM x

References