Skip to main content

What does USING do in a JOIN?

USING in a JOIN is a shorthand for the join condition, used when the columns in both tables share the same name.

Example

sql
SELECT * FROM orders JOIN customers USING (customer_id);

This is the same as:

sql
SELECT * FROM orders JOIN customers ON orders.customer_id = customers.customer_id;

The difference: with USING, the result has only one customer_id column, not two (one from each table).

Short Answer

Interview ready
Premium

A concise answer to help you respond confidently on this topic during an interview.