update a set va=(select max(vb) from b where b.id=a.id)
where exists(select 1 from b where b.id=a.id);

解决方案 »

  1.   

    where exists(select 1 from b where b.id=a.id);
    为什么还要加它呢?请执教?
      

  2.   

    写plsql.
    declare 
    curcor c_1 is
    select a.id, b.vb from a, b where a.id=b.id;
    begin
      for r_c1 in c_1 loop
        update a set va=r_c1.vb where id=r_c1.id;
        commit;
      end loop;
    end;
      

  3.   

    对了,大哥,为什么还要加这句where
    where exists(select 1 from b where b.id=a.id);
      

  4.   

    update (select a.va as va1,b.va as va2 from a,b where a.id=b.id) set va1=va2
      

  5.   

    update a set va=(select max(vb) from b where b.id=a.id)
    where exists(select 1 from b where b.id=a.id);