sqlcheck icon indicating copy to clipboard operation
sqlcheck copied to clipboard

JOIN USING triggers a query anti-pattern

Open perdiesman opened this issue 2 years ago • 0 comments

When doing a join with a using such as:

SELECT t1.col1, t2.col2
FROM t1
    JOIN t2 USING (col1);

this is triggering:

(HIGH RISK) (QUERY ANTI-PATTERN) JOIN Without Equality Check
● Use = with JOIN:
JOIN should always have an equality check to ensure proper scope of records.

I would think that USING would be an equality check as the field values have to match for the join.

perdiesman avatar Nov 17 '23 13:11 perdiesman