Summary of left, right, and fully connected learning

Source: Internet
Author: User
Internal join: inner join or join to check the data corresponding to the two tables.
Outer Join: Outer Join, which identifies the corresponding data based on a table and is divided into left Outer Join and right outer join.
Left Outer Join: left join or left Outer Join. The corresponding data is retrieved based on a table.
Outer right join: Right join or right outer join. The corresponding data is retrieved based on a table.
Full join: Full join, based on multiple tables

Student table
No name
1
2 B
3 C
4 d

Grade table
No grade
1 90
2 98
3 95
5 90

Inner join: The data corresponding to the search condition. No data is listed in No4.
Syntax: Select * from student inner join grade on student. No = Grade. No
Result:
No name no grade
1 A 1 90
2 B 2 98
3 C 3 95

Left join: All data in the left table, corresponding data in the right table
Syntax: Select * from student left join grade on student. No = Grade. No
Result:
No name no grade
1 A 1 90
2 B 2 98
3 C 3 95
4 d

Right join: All data in the right table, corresponding data in the left table
Syntax: Select * from student right join grade on student. No = Grade. No
Result:
No name no grade
1 A 1 90
2 B 2 98
3 C 3 95
5 90

Full connection
Syntax: Select * from student full join grade on student. No = Grade. No
Result:
No name grade
1 A 90
2 B 98
3 C 95
4 d
1 A 90
2 B 98
3 C 95

Note: you cannot directly use full join in access. You must use Union all to merge the left and right connections.

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.