Outer Join, left Outer Join
Definition: Used to query records that meet the connection conditions and do not meet the connection conditions.
Query emp table records
SELECT * FROM emp;Empno ename job mgr hiredate sal comm deptno1 7369 smith clerk 7902 800.00 202 7499 allen salesman 7698 1600.00 300.00 303 7521 ward sale
There are 3 Oracle connection queries: cross-Connect, inner-join, outer-join.
The result of a cross join is a superset of the results of other connections, and the outer join result is a superset of the result of the inner
Label:1, Cross join: There are two, explicit and implicit, without an ON clause, returns the product of two tables, also known as the Cartesian product, the number of returned records should be in a and B table in accordance with the record and. Explicit: SELECT [Cols_list] from aCross Joinb where [condition] implicit: SELECT [Cols_list] from a,b where [condition] 2, INNER join (INNER
Resolution: inline, left outer, right outer, full join, Cross join difference bitsCN.com
Connections include: internal connection, external connection, and cross connection.I. inner connection-the most commonDefinition:Only the rows in the two tables that meet the connection conditions are combined as the result set.In
. External Connection1. Left (outer) joinDefinition: Based on the internal join, it also contains all data rows that do not meet the conditions in the left table, and fill in NULL in the right table column.Keyword: LEFT JOINEg:Select *From t_institution ILeft outer join t_teller tOn I. inst_no = t. inst_noOuter can be
[OUTER] JOIN(1) SELECT * from TableAFull OUTER JOINTableB on tablea.name = Tableb.name
Col span= "4" width= "$" >
result set
(TableA.)
ID
name
ID
name
Pirate
2
Pirate
2
Monkey
null
3
Ninja
. External Connection1. Left (outer) joinDefinition: Based on the internal join, it also contains all data rows that do not meet the conditions in the left table, and fill in NULL in the right table column.Keyword: LEFT JOINEg:Select *From t_institution ILeft outer join t_teller tOn I. inst_no = t. inst_noOuter can be
The most common view is to make the left outer connection. and its role, especially when we query the user's current permissions is particularly obvious, we will be the permissions table is the module table put → role permissions table → role table → user role table → user table so that the left outer join connection, so that the user's permissions can be queried
The relationship between the employee and the boss in the EMP tableInternal connections:The inner join is also called a natural connection, which is a common method of combining two tables. A natural connection compares columns in two tables, combining rows in two tables that meet the conditions of the join, as a result. A natural connection has two forms of syntax.Select E1.ename,e1.mgr,e2.ename AA from EM
Differences between inner join, left JOIN, right join, outer join in SQLFor example, you'll know!Table A (A1,B1,C1) b (A2,B2)A1 B1 C1 A2 B201 Mathematics 95 01 Sheets Three02 Language 90 02 John Doe English Harry Select A.*, b.* from AINNER
columns in the connected table, including duplicate columns, are listed in the query results.
2. Unequal join: Use a comparison operator other than the equal operator to compare the column values of the connected columns. These operators include >,>=,
3. Natural join: Use the equal to (=) operator in the connection condition to compare the column values in the connected column. However, it uses the select
Various joins in MySQL
1. Cartesian Product (cross join)
In MySQL, you can think of cross join or omit cross as join, or use ','
For example
Select * From Table1 cross join Table2
Select * From Table1 join Table2
Select * From Table1, Table2
Because the returned result is
is as follows: SELECT * from A joins B on A.aid=b.bnameid run results as shown in 4: actually select * from A, A where a.aid= B.bnameid and select * from A JOIN B on A.aid=b.bnameid run the same result.Figure 4: Internal connection data2. Outer joins: There are two types of outer joins, one is the left join and the ri
Difference between left Outer join and Outer Association (+) in "original" Oracle 2008-03-23 16:22:37
url:http://space.itpub.net/?uid-6517-action-viewspace-itemid-216974
difference between on and where in Oracle's left join 2009-09-28 15:20
Url:http://hi.baidu.com/bfsll/blog/item/3a884e2f0fc905321e3089a7.html
Tod
Tags: style blog c http a widthFor SQL joins, learning may be a bit confusing. We know that the join syntax for SQL has a lot of inner, outer, left, and sometimes it's not very clear what the result set looks like for a select. There is an article on Coding horror that explains the join of SQL through the Venn diagrams of the Venturi diagram. I feel clear and und
1. Internal connection is simpleSelect A.*, b.* from, b where a.id = b.IDSelect A.*, b.* from A inner join B on a.id = b.IDThe above two sentences are completely equivalent.2. Left Outer connectionSELECT * FROM EMP a LEFT JOIN Dept D on A.deptno=d.deptnoSELECT * from emp a,dept D where A.deptno=d.deptno (+)The above two sentences are completely equivalent.3. Righ
The following articles mainly describe the table connection statements for Oracle Outer join and cross join. Oracle database connections include the inner join statements) oracle Outer join, full
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.