外连接
例子:
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.   

    外连接
    例子:
    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>
      

  2.   

    select * from a,b where a.id=b.id(+)  --相当于 select * from a left join b on a.id=b.id;select * from a,b where a.id(+)=b.id  --相当于 select * from a right join b on a.id=b.id;