Skip to content

inconsistent-reference

SQLstyleno fixdefault: offsql/sqlfluff

Reports a select over one table in which some column references are qualified (t.a) and others are not.

Mixed forms make the reader wonder whether the two refer to the same thing. With one table, one style is enough for every reference, and the unqualified one becomes ambiguous once a join is added.

To fix, qualify all of them, or none.

Reported
...
select t.a, b from t;
...
with c as (select a from t) select * from c;
...
sql:
lint:
rules:
inconsistent-reference: warn # off (default), warn, error

Enabled by the presets: sql/sqlfluff.

Suppress one line with sudsy-disable-next-line inconsistent-reference 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 RF03 full