1024programmer PHP PHP left inner join, what is the difference between inner join and outer join

PHP left inner join, what is the difference between inner join and outer join

The difference between inner join and outer join: 1. The connection results are different. The connection result of the inner join only contains the rows that meet the connection conditions, while the connection result of the outer join contains the rows that meet the connection conditions; 2. The precautions are different. Inner joins need to pay attention to the difference between any and all used in nested queries. Outer joins do not need to be distinguished, and neither the left table nor the right table is restricted.

38365b8fd6ee3045c36ec0b5e2462b8b.png

This article Environment: Windows7 system, Dell G3 computer.

The difference between inner join and outer join:

The difference between inner join and outer join in the database mainly lies in the different connection results and different precautions, as follows:

1. The connection result is different

The connection result of the inner connection only contains the rows that meet the connection conditions, and the two tables participating in the connection must meet the connection conditions; the connection result of the outer connection not only contains the rows that meet the conditions Rows with join conditions, and rows that do not meet their own conditions, including left outer joins, right outer joins, and full outer joins.

2. Different precautions

Inner joins need to pay attention to the difference between any and all used in nested queries; outer joins do not need to be distinguished, neither the left table nor the right table Restricted, all records are displayed, and null can be used to fill in the insufficient places of the two tables.

27e14513f78faa18dd031fd424fdddb1.png

Inner connection Refers to the most common equivalent connection; left outer connection refers to the addition of unmatched data in the main table on the basis of the equivalent connection, and the right outer connection is the same; full outer connection refers to the equivalent connection On the basis of , the unmatched data in the left table and the right table are added together.

This article is from the internet and does not represent1024programmerPosition, please indicate the source when reprinting:https://www.1024programmer.com/php-left-inner-join-what-is-the-difference-between-inner-join-and-outer-join/

author: admin

Previous article
Next article

Leave a Reply

Your email address will not be published. Required fields are marked *

Contact Us

Contact us

181-3619-1160

Online consultation: QQ交谈

E-mail: 34331943@QQ.com

Working hours: Monday to Friday, 9:00-17:30, holidays off

Follow wechat
Scan wechat and follow us

Scan wechat and follow us

Follow Weibo
Back to top
首页
微信
电话
搜索