如下所示sql:
select * from class_table a, class_table b
where a.class_id=b.class_id(+) and a.stu_place=b.stu_place(+)
and a.sex='男' and b.sex='女'
为什么外连接加不加查询出的数据都是一样的,谢谢...

解决方案 »

  1.   

    你那个数据已经把空的部分过滤掉了。
    SQL> select * from a;
     
            ID ORG_NAME   LINK_NAME
    ---------- ---------- ----------
             1 公司1      eer
             2 公司2      ddf
             3 ggg        ggg
     
    SQL> select * from b;
     
            ID LINK_NAME
    ---------- ----------
             1 66
             4 88
             5 gfh
     
    SQL> select * from a,b where a.id=b.id(+);
     
            ID ORG_NAME   LINK_NAME          ID LINK_NAME
    ---------- ---------- ---------- ---------- ----------
             1 公司1      eer                 1 66
             3 ggg        ggg                   
             2 公司2      ddf                   
     
    SQL> select * from a,b where a.id=b.id;
     
            ID ORG_NAME   LINK_NAME          ID LINK_NAME
    ---------- ---------- ---------- ---------- ----------
             1 公司1      eer                 1 66
     
      

  2.   

    二楼已经解答。另inner join on 和where 条件结果是一样。不同用法而已。