Question

Take a look...

http://search.mysql.com/search?site=refman-41&q=using&lr=lang_en

The official MySQL site doesn't explain the USING command.

Can you do that please?

Was it helpful?

Solution

USING is a variation of the ON keyword in join syntax. This link explains it in detail. In the example, the query

SELECT C.First_Name, C.Last_Name, O.title
FROM Employee AS C
LEFT JOIN job as O USING (ID);

is identical to

SELECT C.First_Name, C.Last_Name, O.title
FROM Employee AS C
LEFT JOIN job as O ON C.ID = O.ID;

OTHER TIPS

It's used for JOINs:

MySQL: 12.2.8.1. JOIN Syntax

"The USING(column_list) clause names a list of columns that must exist in both tables. If tables a and b both contain columns c1, c2, and c3, the following join compares corresponding columns from the two tables."

It is used in JOINs, I think you can get here some more information about it.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top