Reference: http://www.cuiyongjian.com/post-130.html
In Oracle SQL statements commonly used connections have internal connection (inner join), outer join (outer join), etc., including the equivalent connection, non-equivalent connection, self-connection, and the outside connection is divided into left and right connections. The default is an in-connection equivalent connection.
In order to facilitate the creation of two of the simplest tables A, B, the specific table structure see below, to analyze the difference between the inner and outer joins
Figure 1
Figure 2
Two tables to make a connection, you must have a connection field, and the Join field in table A and table B is aid and BNAMID, which illustrates the relationship between connections Figure 3
Figure 3
(1) Inner connection: Using the inner Connection (equivalent) to obtain the blue public part C, which is the DataSet C in Figure 3, the result set is as follows:
Figure 4
In fact select * from A joins B on A.aid=b.bnamid; equivalent to select * from A, where A.aid=b.bnamid;
Note: Non-equivalent connection is the main word for a range to query the data, self-connection is the main 1 of the table can be called two tables to use
(2) Outer connection: divided into left outer join (right join)
The left outer connection, the blue part of the public display, c1+ shows the yellow recordset A1, and the display statement is equivalent to the SELECT * from A, where a.aid=b.bnamid (+);
Figure 5
The right outer connection, the blue part of the public display, c1+ shows the green B1, and the display statement is equivalent to the SELECT * from A, where A.aid (+) =b.bnamid;
Figure 6
Table A and Table B are relative, the above experiment is a on the left of the case, in fact a to join B and B right join a in the case of the result set is the same.
Go: internal and external connections for SQL