语句如下
update tablename t set colname=(select colname 
                                from tablename2 t2
                                where t.colname1=t2.colname1 and.....)
where t.colname='0001"     
数据量不是很大就五六百条,但是更新速度非常慢,请高手指点。

解决方案 »

  1.   

    不会把,兄弟
    如果不加最后一个where,1万条才需要30秒左右,为什么???
      

  2.   

    可以在tablename的colname1列和tablename2的colname1列建立索引,另外,可以试一下以下的
    update语句:
    update tablename t set colname =
    nvl((select colname from tablename2 t2
         where t.colname1=t2.colname1 and..... and rownum = 1
        ),t.colname
       )
       where t.colname='0001"