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);
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);
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)