两表关联更新数据——oracle

前端之家收集整理的这篇文章主要介绍了两表关联更新数据——oracle前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
update testa a set(name,remark)=(select b.name,b.remark from testb b where b.id=a.id)   where exists(select 1 from testb b where b.id=a.id)  ;

 

(where exists(select 1 from testb b where b.id=a.id):如果没有这个条件,不匹配的选项也会被更新。

猜你在找的Oracle相关文章