MySQL Multi-table connection

Source: Internet
Author: User

Cartesian product Select * from a a a B; no conditions are required, two tables are multiplied.

Connection type: Cross connection, inner connection, outer connection.

(1) Cross connection, basically is the same as the Cartesian product connection. SELECT * from A Cross join B where .....

(2) Inner connection: Natural connection, equivalent connection, non-equivalent connection.

A. Natural connection: Use the = operator in the join condition to compare the column values of the join column, but delete the duplicate columns in the Join table.

B. Equivalent connection: Do not delete duplicate columns, a INNER join B on a.id=b.id (can also be implicitly A,bwhere a.id=b.id) A, a, a, a, A and B.

C. Non-equivalent connection: Connect two tables with the <,> operator.

(3) Outer connection: Left outer connection, right outer connection, full outer connection.

A. Left outer connection a outer join B on A.id=b.id

B. Right outer connection A left OUTER join B on A.id=b.id

C. Full outer connection A outer JOIN on A.id=b.id

MySQL Multi-table connection

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.