Search code examples
mysqljoinusing

explain the USING command


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?


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;