MySQL join using () Usage

Source: Internet
Author: User

1 using () is used for join queries on two tables. The column specified by using () must exist in both tables and is used as the join condition. Example: select. *, B. * from a left join B using (colA); equivalent to: select. *, B. * from a left join B on. colA = B. colA;
2 Multi-table queries use multiple such joins. Example: select. *, B. * from a left join B using (colA) left join c using (colB); colA must exist in tables a and B, and colB in tables a and c.
In short, using () is short for specifying connection conditions in join, which is often used in simple connections. When the column names are different or the connection conditions are complex, it is more common to use a left join B on.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.