我想把
  SATBSTDCUS.crsysdt = (select max(crsysdt) from SATBSTDCUS where PLANT = imtbinvmst.Plant
      AND MATNO = imtbinvmst.matno )条件加在 left outer join中去,不清楚该怎么实现出来?还有如果两个做外连接的表要用到两个以上的列的话,该怎么用?
  能这样吗? select
           from A left outer join on a.column1= B.column1(+) and a.column2=b.column2(+)
 但是我这里要牵扯到多个表,如果如下链接的话,Oracle会出现以下错误信息:
    A.matno = B.matno(+)
      AND A.plant(+)= C.plant AND A.matno(+)= C.matno
      and A.plant(+)= E.plant AND A.matno(+)= E.matno
      and A.plant(+)= D.plant  AND A.sloc(+)= D.sloc     
      AND B.matgrp(+)= F.matgroup     
      and A.plant(+)= G.plantOracle 会出现以下错误:ORA-01417: a table may be outer joined to at most one other table,烦请高人指导?

解决方案 »

  1.   

    这是oracle的强制要求,表连接时主表只能有一个。外部连接只能连接到一张表  
      生成中间表就可解决问题 
      

  2.   

    写法:
    select a.*,b.* from exp1 a left join exp2 b on a.id=b.id或者select a.*,b.* from exp1 a,exp2 b where  a.id=b.id(+)left join 不要和(+)同时用
      

  3.   

      我的问题大致上解决掉了,我的方案是将表SATBSTDCUS现带上条件后做成一个子查询,该子查询得到的表就成了一个temp表,然后再将该表与主表做外连接即可!多谢二位帮助,马上结帐!