我说的不准确
一个例子:
select a.xm,a.xb,a.csrq,b.xm,b.xb,b.csrq 
from t_ygjbxx a,t_ygqs b
where a.ygid=b.ygid(+)
t_ygjbxx  员工信息  xm 姓名 xb 性别 csrq 出生日期
t_ygqs    员工亲属
每个员工不是都有亲属的,但仍然返回所有员工的信息。

解决方案 »

  1.   

    a表的某列和b表的某列具有共同的域,如果a表的列的值比较全,b表的列的列值不全,则外部连接不但可以显示出两个表共同的列值,还可以显示出a表有而b表没有的列值。查询如下:
    显示a表和b表所有的列值
    select a.col,b.col from a,b where a.col=b.col(+);显示a表和b表共同的列值
    select a.col,b.col from a,b where a.col=b.col;显示出a表有而b表没有的列值
    select a.col,b.col from a,b where a.col=b.col(+) and b.col is null;
      

  2.   

    select a.*,b.* from a,b where a.col1 = b.col1(+)就是外连接。a.col1 = b.col1(+)相当于两部分数据的union,即:(a.col1 = b.col1)和 (rows from a that have no b)
      

  3.   

    a.col1 = b.col1(+)相当于两部分数据的union  ???
    怎么是union呢?
      

  4.   

    在scott/tiger用户下,试试这个语句select a.deptno,a.dname,b.ename from dept a,emp b
    where a.deptno=b.deptno(+);看看结果和我的解释就明白了。
      

  5.   

    a.col1 = b.col1(+)
    不僅把公共屬性相等的對應紀錄顯示出來
    還把a表中剩余的那些記錄顯示出來﹐對應的b表字段補成null值a.col1(+)=b.col 同理
      

  6.   

    If a row does not satisfy a join condition, the row will not appear in the query result. For example, in the equijoin condition of EMP and DEPT tables, department OPERATIONS does not appear because no one works in that department.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.)
      

  7.   

    外连接:这是一个保存不完整记录的连接.在这种情况下,两个表之间不存在匹配条件,oracle 返回满足连接条件的所有记录,如果在表中找不到与外部连接符匹配的记录,oracle将返回没有外部连接符的表中的所有记录.