Home > Common Problem > What is the difference between inner join and outer join

What is the difference between inner join and outer join

coldplay.xixi
Release: 2023-01-13 00:27:02
Original
85477 people have browsed it

The difference between inner join and outer join: 1. The connection results are different. The connection result of inner join only contains the rows that meet the connection conditions, while the connection result of outer join contains the rows that meet the connection conditions; 2. Note The matters are different. For inner joins, you need to pay attention to distinguishing the difference between any and all used in nested queries. For outer joins, there is no need to distinguish, and neither the left table nor the right table is restricted.

What is the difference between inner join and outer join

#The operating environment of this article: Windows 7 system, Dell G3 computer.

The difference between inner joins and outer joins:

The difference between inner joins and outer joins in the database mainly lies in the different connection results and different precautions, as shown below:

1. Different connection results

The connection result of the inner join only contains rows that meet the join conditions, and both tables participating in the join must meet the join conditions; while the outer join The join result of the join includes not only rows that meet the join conditions, but also rows that do not meet its own conditions, including left outer joins, right outer joins, and full outer joins.

2. Different precautions

Inner joins need to pay attention to distinguishing the difference between any and all used in nested queries; outer joins do not need to distinguish, the left table and The right table is unrestricted, all records are displayed, and the insufficient places in the two tables can be filled with nulls.

What is the difference between inner join and outer join

Inner join refers to the most common equijoin; left outer join refers to adding unmatched data in the main table on the basis of equijoin , the right outer join is the same; the full outer join means to add the unmatched data in the left table and the right table together based on the equivalent join.

The above is the detailed content of What is the difference between inner join and outer join. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template