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

An example Analysis of the connection represented by the symbol of sql statement (+) in Oracle

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

Share

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

Editor to share with you the Oracle sql sentence (+) symbol on behalf of the connection example analysis, I believe that most people do not know much about it, so share this article for your reference, I hope you will learn a lot after reading this article, let's go to understand it!

The sql statement (+) symbol in oracle represents the connection.

(+) right connection in front of =

(+) left connection after =

SELECT a. From a right join b, b. * from a (+) = b is a right join, which is equivalent to a right link.

SELECT a, b. * from a = b (+) is a left join, which is equivalent to select a. From a left join b.

Internal connection

The commonly used join operator =,

Use the comparison operator to match rows in two tables based on the values of the columns common to each table

External connection

Left connection

LEFT JOIN or LEFT OUTER JOIN

List all the rows in the left table. If a row in the left table has no matching row in the right table, the left table outputs the row, and the right table has a blank row.

Right connection

RIGHT JOIN or RIGHT OUTER JOIN

List all the rows in the right table. If a row in the right table does not match in the left table, the right table outputs the row, and the left table has an empty row.

Full connection

FULL JOIN or FULL OUTER JOIN

For all the data in the two tables

When a row in the left table has no matching row in the middle of the right, the left table outputs the row, and the right table has an empty row.

When a row in the right table has no matching row in the left table, the right table outputs the row, and the left table has an empty row.

Example:

-a Table id name b id job parent_id 1 sheet 3 1 23 1 2 Li Si 2 34 23 Wang Wu 3 34 4 a.id has a relationship with parent_id -

Internal connection

Select a. From an inner join b on a.id=b.parent_id. One sheet 3 1 23 1 2 Li Si 2 34 2

Left connection

Select a. Null. * from a left join b on a.id=b.parent_id 1 3 1 23 1 2 Li Si 2 34 23 Wang Wu

Right connection

Select a. From a right join b on a.id=b.parent_id 1 3 1 23 1 2 Li Si 2 34 2 null 3 34 4

Full connection

Select a. Null. * from a full join b on a.id=b.parent_id 1 3 1 23 1 2 Li Si 2 34 2 null 3 34 43 Wang Wu null is all the contents of this article "an example Analysis of the symbolic connection of sql sentences (+) in Oracle". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more 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