1、Oracle 多表更新方法:
update test1
set (test1.name,test1.age)=
(select test2.name,test2.age from test2 where test2.id=test1.id)
2、MySql多表更新方法:
update test1,test2
set test1.name=test2.name,test1.age=test2.age
where test1.id=test2.id
注:多表可 update 表一, 表二 set 。。。。
3、通用方法
update test1
set name=(select name from test2 where test2.id=test1.id),
age=(select age from test2 where test2.id=test1.id)
本文探讨了Oracle通过子查询实现的多表更新方法,以及MySql中直接指定表名的更新方式。两种技术在处理多表关联更新时的差异和应用场景。
7229

被折叠的 条评论
为什么被折叠?



