update table1
set 
f2=(select table2.f2 from table1,table2 where table1.f1=table2.f1)
where f1=(select table2.f1 from table1,table2 where table1.f1=table2.f1);

解决方案 »

  1.   

    如果select table2.f1 from table1,table2 where table1.f1=table2.f1返回的是结果集,就要出错
      

  2.   

    update table1 A
       set f2 = ( select f2 from table2 B where B.f1 = A.F1)
    where A.f1 in ( select f1 from table2);
      

  3.   

    developer2002(开发者2002)的补充很正确。
    如果是记录集,还是写过程吧。
      

  4.   

    update table1
    set 
    f2=(select table2.f2 from table2 where table1.f1=table2.f1 and rownum=1)
    where exists(select table2.f1 from table2 where table1.f1=table2.f1);
      

  5.   

    update table1 set f2=
    (select f2 from table2 where table1.f1=table2.f1 and rownum=1)
    where exists (select 1 from table2 where f1=table1.f1);