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
1. Business scenario introduction Suppose there i...
Tips for sending HTML emails: Use style to write ...
Now if you want to use the video tag in a page, y...
Today I wanted to change the mysql port, but I fo...
In this article we assume you already know the ba...
I encountered such a problem when doing the writte...
This article describes how to add or expand a dis...
Serve: # chkconfig --list List all system service...
When the created tab label exceeds the visible ar...
The implementation method is divided into three s...
It’s great to use CSS to realize various graphics...
Environment configuration 1: Install MySQL and ad...
If you’re new to Docker, take a look at some of t...
Install and configure the MySql database system. ...
This article mainly introduces an example of how ...