select * from bluecoco_temp1 a,bluecoco_temp2 b
where a.str1 =b.str1(+)
union 
select * from bluecoco_temp1 a,bluecoco_temp2 b
where a.str1 (+)=b.str1

解决方案 »

  1.   

    select * from A,B
    where a.ProductID(+)=b.ProductID (+)
      

  2.   

    上面的那个不对,是这个
    select * from A,B
    where a.ProductID(+)=b.ProductID 
    union
    select * from A,B
    where a.ProductID=b.ProductID (+)
      

  3.   

    bluecocoqd(小骗骗)的是对的,晕...
      

  4.   

    a.ProductID(+)=b.ProductID (+)的写法好像不对的,8i以上版本可以这么写 select * from a full outer join b on a.ProductID = b.ProductID
      

  5.   

    duanzilin(寻)是对的,我开始觉得那样可以,不过试了一下发现那样做报错:
    ERROR 位于第 1 行:
    ORA-01468: 一个谓词只能引用一个外部连接表用outer join也不行,还是报错,结果就采用了union。
    没想到有full outer join,学到了!