unqualified-reference
What it does
Section titled “What it does”Reports a column reference without a table in a select over more than one table or view. A name that an alias of another select element or a USING list gives is left alone.
Why it matters
Section titled “Why it matters”With several tables, a name may exist in more than one of them, now or after a column is added. The query then fails as ambiguous, or the reader cannot tell which table a column comes from.
To fix, qualify the column with the table or its alias.
Example
Section titled “Example”...select a, b from t1 join t2 on t1.id = t2.id;...Configuration
Section titled “Configuration”sql: lint: rules: unqualified-reference: warn # off (default), warn, errorEnabled by the presets: sql/sqlfluff.
Suppress one line with sudsy-disable-next-line unqualified-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 | RF02 |
full |