update b set fld2=(select fld1 from a where a.mid=b.mid);

解决方案 »

  1.   

    select fld1 from a where a.mid=b.mid
    可能不止一条记录,无法赋值
      

  2.   

    a表中fld1是不能重复的,所以就不应该出现重复,如果真的重复的话,单条SQL恐怕更新不了吧!
      

  3.   

    update b set fld2=(select fld1 from a where a.mid=b.mid and rownum<2);
      

  4.   

    那为什么在sqlserver 中可以实现,没有道理在oracle 中不能呀。各位请一定帮想想办法,
    小弟先谢过了
      

  5.   

    >spool d:\123.txt
    >select 'update b set mid='||a.mid||',fld2='||a.fld1||'where  mid=a.mid' from a,b where  a.mid=b.mid
    >spool off
    >@d:\123.txt
    在SQL下执行,这样看看行不行!!