unused-alias
What it does
Section titled “What it does”Reports a table alias in a FROM clause that no qualified reference of the select, nested queries included, uses.
Why it matters
Section titled “Why it matters”An alias that nothing uses is left over from an earlier version of the query, or a reference was written without it.
To fix, remove the alias, or use it.
Example
Section titled “Example”...with c as (select a from t) select * from c;select x.a from (select * from t) as x;select a from t as x;select x.a from t as x join u as y on x.id = y.id;Configuration
Section titled “Configuration”sql: lint: rules: unused-alias: warn # off (default), warn, errorEnabled by the presets: sql/sqlfluff.
Suppress one line with sudsy-disable-next-line unused-alias 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 | AL05 |
full |