inner join&left outer join&right outer join 区别
来源:互联网 发布:淘宝卖家淘客怎么设置 编辑:程序博客网 时间:2024/05/02 04:45
By default, a join is assumed to be an inner join. You can also request other types of joins by clicking Join Type on the Joins page of SQL Assist. The following types of joins are available:
- Inner join
- Left outer join
- Right outer join
- Full outer join
7 An inner join is join method in which 7 a column that is not common to all of the tables being joined is dropped from 7 the resultant table. If your database supports the OUTER JOIN keywords, you 7 can extend the inner join to add rows from one table that have no matching 7 rows in the other table.
For example, you want to join two tables to get the last name of the manager for each department. The first table is a Department table that lists the employee number of each department manager. The second table is an Employee table that lists the employee number and last name of each employee. However, some departments do not have a manager; in these cases, the employee number of the department manager is null. To include all departments regardless of whether they have a manager, and the last name of the manager, if one exists, you create a left outer join. The left outer join includes rows in the first table that match the second table or are null. The resulting SQL statement is as follows:
SELECT DEPTNO, DEPTNAME, EMPNO, LASTNAME FROM DEPARTMENT LEFT OUTER JOIN EMPLOYEE ON MGRNO = EMPNO
A right outer join is the same as a left outer join, except that it includes rows in the second table that match the first table or are null. A full outer join includes matching rows and null rows from both tables.
For example, you have two tables, Table 1 and Table 2, with the following data:
You specify a join condition of Column A = Column C. The result tables for the different types of joins are as follows:
- Inner join
-
Table 3. Inner join result table Column A Column B Column C Column D 2 B 2 X - Left outer join
-
Table 4. Left outer join result table Column A Column B Column C Column D 1 A null null 2 B 2 X 3 C null null - Right outer join
-
Table 5. Right outer join result table Column A Column B Column C Column D 2 B 2 X null null 4 2 - Full outer join
-
Table 6. Full outer join result table Column A Column B Column C Column D 1 A null null 2 B 2 X 3 C null null null null 4 2
If you specify value (a,c), you obtain the following result:
- inner join&left outer join&right outer join 区别
- left outer join,inner join,right outer join的区别
- inner join,outer join,left join,right join的区别
- inner join,outer join,left join,right join的区别
- inner join,outer join,left join,right join的区别
- Inner join,outer join,left join,right join的区别
- Inner join,outer join,left join,right join的区别
- SQL中 inner join、 left outer join 、right outer join、 full outer join之间的区别
- JOIN用法 INNER JOIN/LEFT JOIN/RIGHT JOIN/OUTER JOIN
- inner join&left outer join&right outer join
- inner join&left outer join&right outer join
- inner join, left outer join, right outer join
- cross join & natural join & inner join & left outer join & right outer join & full outer join
- 【SQL】inner join、outer join、cross join和left join、right join、full join的区别
- SQL中LEFT JOIN、Inner Join、Right Join、Left Outer Join、full join区别
- left join , right join , full outer join , inner join
- left join,right join,inner join,outer join的用法
- Linq语句实现(INNER JOIN、LEFT OUTER JOIN、RIGHT OUTER JOIN、FULL OUTER JOIN、CROSS JOIN)
- OReilly.Oracle.Essentials.Oracle.Database.11g.4th.Edition.Nov.2007.eBook-BBL
- 试图运行项目时出错:无法启动调试。绑定句柄无效
- HP UNIX 无法打开VNC 特定PORT 进程
- C++ 中 inline 的处理
- 3DGS脚本教程翻译(7)-字符串,文本和字体
- inner join&left outer join&right outer join 区别
- 向女强人致敬!真的很不容易
- 重写GridView实现单击行变色的效果
- 登录页面嵌套在框架中问题
- 常用struts标签使用举例--bean篇(转载)
- 深入浅出Liferay Portal (5)
- (轉)无能的WinXP
- 深入浅出Liferay Portal (6)
- 深入浅出Liferay Portal (7)