oracle 用一個表的數據去更新另一個表的數據

去掉 有重複數據的 狀況 test

 

 merge into acl_user p
    using (select * from testimportuser X where X.ROWID=(select max(Y.ROWID) from testimportuser Y where X.yhdm=Y.yhdm ) ) np
    on (p.yhdm=np.yhdm)
    when matched then
    update set p.sfzmhm=np.sfzhm
    when not matched then insert(p.yhdm,p.xm,p.sfzmhm,p.cjsj)values(np.yhdm,np.xm,np.sfzhm,sysdate)import

相關文章
相關標籤/搜索