-
基于Oracle-SQL语言的外连接
资源介绍
外连接(基于Oracle)
*
SELECT table1.column, table2.column
FROM table1, table2
WHERE table1.column(+) = table2.column;
SELECT table1.column, table2.column
FROM table1, table2
WHERE table1.column = table2.column(+);
可以用外连接来查出在一个表中不匹配连接条件的行.
外连接的符号是: (+).
*
Returning Records with No Direct Match with Outer Joins
The missing row(s) can be returned if an outer join operator is used in the join condition. The operator is a plus sign enclosed in parentheses (+), and it is placed on the “side” of the join that is deficient in information. This operator has the effect of creating one or more null rows, to which one or more rows from the nondeficient table can be joined.
In the syntax:
table1.column = is the condition that joins (or relates) the tables together.
table2.column (+) is the outer join symbol, which can be placed on either side of the
WHERE clause condition, but not on both sides (Place the outer
join symbol following the name of the column in the table without the matching rows.)
Instructor Note
Demo: l4ejoin.sql
Purpose: To illustrate an equijoin leading to an outer join.
- 上一篇: 用非等连接查询记录-SQL语言基础
- 下一篇: 使用外连接-SQL语言基础