The USING clause specifies one or more columns with the same name in both tables and uses those columns as the JOIN condition.
USING can make JOIN statements shorter and easier to read when the related columns have identical names.
Join Employees and Departments using their common DepartmentID column.
SELECT
EmployeeName,
DepartmentName
FROM Employees
INNER JOIN Departments
USING (DepartmentID);
Useful in SQL dialects that support USING, particularly when database schemas consistently use the same key names.
- USING simplifies equality JOIN conditions.
- The column must have the same name in both tables.
- Multiple columns can be specified.
- Not every SQL database supports USING identically.
- ON provides broader and more explicit control.
What does the USING clause do?
It specifies columns with the same name that should be used to match rows between tables.
When can USING be used?
It can be used when the related JOIN columns have the same name in both tables and the database supports the syntax.