update table1 set f1=b.f1,f2=b.f2,f3=b.f3 
from table1 a,bable2 b where a.id=b.id
--------->>>>
update table1 
set f1=(select b.f1 from bable2 b,table1 a where a.id=b.id),
f2=(select b.f2 from bable2 b,table1 a where a.id=b.id),
f3=(select b.f3 from bable2 b,table1 a where a.id=b.id)
where exist(select 1 from bable2 b,table1 a where a.id=b.id)

解决方案 »

  1.   

    oracle要这样写
          update table1 
    set f1=(select b.f1 from bable2 b,table1 a where a.id=b.id),
    f2=(select b.f2 from bable2 b,table1 a where a.id=b.id),
    f3=(select b.f3 from bable2 b,table1 a where a.id=b.id);
      

  2.   

    update table1 set (f1,f2,f3)=select f1,f2,f3 from bable2 b where a.id=b.id
    where exist(select 1 from bable2 b,table1 a where a.id=b.id)
      

  3.   

    update table1 
    set
    f1=(select b.f1 from bable2 b,table1 a where a.id=b.id),
    f2=(select b.f2 from bable2 b,table1 a where a.id=b.id),
    f3=(select b.f3 from bable2 b,table1 a where a.id=b.id);
      

  4.   

    update table1 a set (f1,f2,f3)=(select f1,f2,f3 from bable2 b where a.id=b.id)