oracle 用一个表的数据去更新另外一个表的数据

前端之家收集整理的这篇文章主要介绍了oracle 用一个表的数据去更新另外一个表的数据前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

去掉 有重复数据的 情况

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)

猜你在找的Oracle相关文章