Skip to content

implicit-alias

SQLstyleno fixdefault: offsql/sqlfluff

Reports a table or column alias written without the AS keyword.

The alias of a column is easy to confuse with a missing comma: select a b from t is one column named b, and select a, b from t is two. AS makes it explicit.

To fix, write AS before the alias.

Reported
...
select a from t left join u on t.a = u.a;
...
select a b, c as d from t u join v as w on u.a = w.a;
...
sql:
lint:
rules:
implicit-alias: warn # off (default), warn, error

Enabled by the presets: sql/sqlfluff.

Suppress one line with sudsy-disable-next-line implicit-alias 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 AL01 full
sqlfluff AL02 full