Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the difference between the left connection and the right connection of sql

2025-04-04 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly introduces what is the difference between the left connection and the right connection of sql. The article is very detailed and has certain reference value. Interested friends must finish reading it!

Sql left join and right join difference: 1, the left join as long as there are records in the left table, the data can be retrieved, while the right join is as long as there are records in the right table; 2, the left join is the data in the left table as the benchmark, and the right join is the reverse join of the left to outer join.

The difference between the left connection and the right connection of sql:

1. The meaning is different

Left join: as long as there are records in the left table, the data can be retrieved, while some records on the right can be retrieved only if there are records in the left table.

Right join: the right connection is that as long as there are records in the right table, the data can be retrieved.

2. The usage is different

The right connection is the opposite of the left connection, the left connection A LEFT JOIN B, the data of the connection query, must have in A, can have or not in B. Internal connection An INNER JOIN B, which is also available in A, and some data in B can be queried.

3. The null value is different.

The left join is based on the data in the left table. If there is data in the left table, there is no data in the right table, then the data in the right table is empty.

The right join is the reverse join of the left outer join. All rows of the right table are returned. If a row of the right table does not match in the left table, a null value is returned for the left table.

These are all the contents of this article entitled "what are the differences between left and right links in sql". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report