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 sql left join command

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

Share

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

This article mainly introduces "what is sql left join command". In daily operation, I believe many people have doubts about what is sql left join command. The editor consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful for you to answer the doubts about "what is sql left join command"! Next, please follow the editor to study!

Example table a

Aid adate

1 a1

2 a2

3 a3

Table b

Bid bdate

1 b1

2 b2

4 b4

The two tables are connected to each other. To take out the same fields of id

Select * from an inner join b on a.aid = b.bid this is to take out only the matching data.

What is taken out at this time is:

1 a1 b1

2 a2 b2

Then left join refers to:

Select * from a left join b on a.aid = b.bid

First, take out all the data in table a, and then add the data that matches aformab.

What is taken out at this time is:

1 a1 b1

2 a2 b2

3 A3 null character

There is also right join.

It means to take out all the data in table b first, and then add the data that matches aforme b

What is taken out at this time is:

1 a1 b1

2 a2 b2

4 null character b4

LEFT JOIN or LEFT OUTER JOIN.

The result set of the left outer join includes all rows of the left table specified in the LEFT OUTER clause, not just the rows matched by the join column. If a row of the left table does not match in the right table, all select list columns of the right table in the associated result set rows are null.

At this point, the study of "what is the sql left join command" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

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