The syntax for an outer join is as follows:
Left Outer JoinThe result set of the left outer join contains all records in the left table and the records in the right table that meet the join conditions. The column values from the right table that do not meet the join conditions in the result set are null. LEFT JOIN Right Outer JoinA right outer join is the reverse of a left outer join. The result set of a right outer join includes all records in the right table and records in the left table that meet the join conditions. The column values of the source and left tables that do not meet the join conditions in the result set are null. Inner JoinThe inner join query compares each row of table T1 with each row of table T2 and finds the combination that satisfies the join predicate. When the join predicate is satisfied, the matching rows in A and B are combined column-wise (side-by-side) into a single row in the result set. Here are a few examples to explain in detail:T1 table:
T2 table:
Inner join result: SELECT T1.*,T2.* FROM TI INNER JOIN T2 ON A.Id=B.Id
Left join result: SELECT T1.*,T2.* FROM TI LEFT JOIN T2 ON A.Id=B.Id
Right join result: SELECT T1.*,T2.* FROM TI RIGHT JOIN T2 ON A.Id=B.Id
SummarizeThis is the end of this article about MySQL outer join and inner join queries. For more relevant MySQL outer join and inner join query content, please search for previous articles on 123WORDPRESS.COM or continue to browse the following related articles. I hope everyone will support 123WORDPRESS.COM in the future! You may also be interested in:
|
<<: Analysis of Facebook's Information Architecture
>>: Detailed explanation of the relationship between React and Redux
Docker installation Install dependency packages s...
=================================================...
Problem Description When VMware Workstation creat...
This article describes the mysql show operation w...
Table of contents The first step is to download M...
We know that there are two ways to receive incomi...
1. Resume nacos database Database name nacos_conf...
Record the problems you solve for others. Problem...
This article shares the use of js and jQuery tech...
CentOS 6 and earlier versions provide MySQL serve...
Table of contents Normal loading Lazy Loading Pre...
This article mainly introduces the example analys...
Differences between Docker and Docker Machine Doc...
Table of contents Why use day.js Moment.js Day.js...
This article shares the specific code for impleme...