用in条件的时候特别慢,改为关联会好很多,但我只在select 的时候用过关联,不知道update 的时候能不能用,如下面这句:update info_customer t set (dept_no,customer_no)
=(select dept_no,customer_no from p_info_customer t1 where t1.rowid=t.tibco_pk) where t.tibco_pk in (select tibco_pk from info_customer_temp t2 where to_char(create_date,'mmdd')='0116')

解决方案 »

  1.   

    update info_customer t set (dept_no,customer_no)
    =(select dept_no,customer_no from p_info_customer t1 where t1.rowid=t.tibco_pk) 
    where  exists (select 'X' from info_customer_temp t2 where to_char(create_date,'mmdd')='0116' and t.tibco_pk=t2.tibco_pk)
      

  2.   

    可以用关联的。dml语句在关键字上基本上通用
      

  3.   

    这样把in改为exists是能提高效率,但如果两个表在不同系统的话是不是用关联好点?
      

  4.   

    都是oracle但表分布在不同主机上,如在info_customer所在主机建立dl的dblink到info_customer_temp所在主机上,既 info_customer_temp@dl 的时候