How does SELECT * FROM a JOIN b USING (id) differ from the same join written with ON a.id = b.id?
Correct answer
C. The join column appears once, so an unqualified id becomes unambiguous
22 views
C. The join column appears once, so an unqualified id becomes unambiguous
22 views
USING names the join columns once, so the result has a single merged column and an unqualified reference to it resolves without ambiguity; with ON both columns survive and must be qualified. USING also suppresses the duplicate key that SELECT * would otherwise expose. The columns must share a name, but neither has to be declared NOT NULL for the join to work.
Asked in: NTS, PPSC IT, Interviews
Not sure why the answer is C? Ask here and get an explanation.