oracle中的外连接:SQL> select * from a1;BBB
----------
101
102
103
104
105SQL> select * from a2;BBB        CCC
---------- --------------------
101
102
105SQL> select * from a1,a2 where a1.bbb(+)=a2.bbb;BBB        BBB        CCC
---------- ---------- --------------------
101        101
102        102
105        105SQL> select * from a1,a2 where a1.bbb=a2.bbb(+);BBB        BBB        CCC
---------- ---------- --------------------
101        101
102        102
103
104
105        105SQL>

解决方案 »

  1.   

    select * from (select .. from ..) a1,
                  (select .. from ..) a2 
     where a1.col1(+) = a2.col1;
    这样同样可以的。
      

  2.   

    三个关联是一样的,但要主义关系。在oracle中支持子查询,也就是将查询结果当成表来使用,你不要考虑它是一个查询,尽管当成表来用就行了。
    select * from (select .. from ..) a1,
                  (select .. from ..) a2, 
                  (select .. from ..) a3 
     where a1.col1(+) = a2.col1 and
           a3.col1(+) = a2.col1;
    当然,WHERE部分一定要修改的,对于外连接涉及到多个表时比较复杂,你还是看看有关书籍为好。