Connection between left and right of mysql and internal connection of cainiao

Source: Internet
Author: User

Connection between left and right of mysql and internal connection of cainiao
1. create a table: boy and insert several lines of data. Java code: create table boy (
Name varchar (10 ),
Flower varchar (10)
); Java code insert into boy
Values
("Lin shuhao", "Rose "),
("Liu Xiang", "Peach Blossom "),
("Jay Chou", "Jasmine "),
("Sharp brother", "Lotus "),
("Andy Lau", "dog tail flower ");
 
 
2. create a table: girl and insert several rows of data. Java code: create table girl (
Name varchar (10 ),
Flower varchar (10)
); Java code insert into girl
Values
("Avier", "Rose "),
("Mrs Curie", "Peach Blossom "),
("Sister Furong", "Jasmine "),
("Fengjie", "Jasmine "),
("Lin Zhiling", "Lotus ");
 
 
3. test:

 
 
Note: In the left join, how many rows are there in the table? Neither the number of rows in the boy table nor the number of rows in the girl table, nor the number of rows in the boy table multiplied by the number of rows in the girl table, is determined by the on condition. But it must be greater than or equal to the number of rows in the left table. For example, if there is no matching match on the right, use null to complete the match in the girl table.

Differences between left and right connections:
A stands on the left of B = B stands on the right of.
A left join B = B right join.

Internal Connection:
Query all data in both the left and right tables.
The inner connection is the intersection of left and right connections.


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.