Skip to content

inner-join

SQLstyleno fixdefault: offsql/sqlfluff

Reports a JOIN with no join type, which is an inner join.

JOIN alone leaves it to the reader to know that it means INNER JOIN (and not left). The keyword makes the intent explicit next to LEFT JOIN.

To fix, write INNER JOIN.

Reported
...
select a from t left join u on t.a = u.a;
...
select a b, c as d from t u join v as w on u.a = w.a;
select a from t join u on t.a = u.a inner join v on v.a = t.a;
...
;
...
sql:
lint:
rules:
inner-join: warn # off (default), warn, error

Enabled by the presets: sql/sqlfluff.

Suppress one line with sudsy-disable-next-line inner-join 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 AM05 full