inconsistent-reference
What it does
Section titled “What it does”Reports a select over one table in which some column references are qualified (t.a) and others are not.
Why it matters
Section titled “Why it matters”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.
Example
Section titled “Example”...select t.a, b from t;...with c as (select a from t) select * from c;...Configuration
Section titled “Configuration”sql: lint: rules: inconsistent-reference: warn # off (default), warn, errorEnabled by the presets: sql/sqlfluff.
Suppress one line with sudsy-disable-next-line inconsistent-reference in a comment of the file’s language.
Upstream equivalents
Section titled “Upstream equivalents”The same check in other tools; Sudsy reports what each upstream rule reports.
| Tool | Rule | Match |
|---|---|---|
| sqlfluff | RF03 |
full |