Skip to content

unknown-columns

SQLstyleno fixdefault: offsql/sqlfluff

Reports a wildcard of the outermost query that resolves to a table: a * over a table, or over a subquery or common table that has one itself.

The columns of the result are whatever the table has now. A column added or reordered in the table changes the result of the query, and clients that read the result by position or by name break.

To fix, list the columns.

Reported
select * from t;
...
sql:
lint:
rules:
unknown-columns: warn # off (default), warn, error

Enabled by the presets: sql/sqlfluff.

Suppress one line with sudsy-disable-next-line unknown-columns in a comment of the file’s language.

The same check in other tools; Sudsy reports what each upstream rule reports.

Tool Rule Match
sqlfluff AM04 full