求教
update table1
set table1.col1=(select table2.col1 from table2 where table1.id=table2.id)
这个sql怎么改 才能提高效率

解决方案 »

  1.   


    --没验证过,你试试
    update table1
    set table1.col1=table2.col1
    where table1.id=table2.id;
      

  2.   


    oracle 没有此种写法,实验失败
      

  3.   

    update table1
    set table1.col1=(select table2.col1 from table2 where table1.id=table2.id)
    这个sql怎么改 才能提高效率如果需要更新,只有这样, 
      

  4.   

    update (select t1.coll c1, t2.col1 c2 from table1 t1, table2 t2 where t1.id=t2.id)
    set c1 = c2
    hash比loop要占优势,尤其是大规模数据的时候