The centralized type difference of MySQL multi-table query

Source: Internet
Author: User

1, inner connection inner JOIN

An inner connection, also known as an equivalent connection, inner join produces a set of data that conforms to both A and B tables.

INNER JOIN syntax

SELECT * FROM A inner join B on a.name = B.name;

2, natural connection category left join and right join
Left join, (or left outer join: equivalent in MySQL, we recommend using the left join. A left connection from the left table (A) produces a complete set of records, with matching records (right table (B)). If there is no match, the right side will contain null.
Right Join table produces a complete set of records with matching records (left table) if there is no matching left table to null

Left JOIN connection syntax
SELECT * from A LEFT join B on a.name = B.name;

Right JOIN syntax
SELECT * from A LEFT join B on a.name = B.name;


The centralized type difference of MySQL multi-table query

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.