self-alias
What it does
Section titled “What it does”Reports an alias that repeats the name it is given to, as in a AS a.
Why it matters
Section titled “Why it matters”The alias does nothing: the name of the column is already a.
To fix, remove the alias.
Example
Section titled “Example”...select distinct a from t;select a from t group by a;select a as a, b as c, d.e as e from t;...select a from t join u on t.a = u.a join v on t.a = v.b;...Configuration
Section titled “Configuration”sql: lint: rules: self-alias: warn # off, warn (default), errorEnabled by the presets: sql/sqlfluff.
Suppress one line with sudsy-disable-next-line self-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 | AL09 |
full |