1. 多表关联update单字段
update stu t set t.NAME = (select t1.NAME from stu1 t1 where t1.ID = t.ID)
where exists(select 1 from stu1 t1 where t1.ID = t.ID);
2.多表关联update多字段
update stu t set (t.NAME, t.SEX) = (select t1.NAME, t1.SEX from stu1 t1 where t1.ID = t.ID)
where exists(select 1 from stu1 t1 where t1.ID = t.ID);
原文链接:https://blog.csdn.net/yfx000/article/details/83409683
本文介绍了如何使用SQL进行多表关联更新操作,包括更新单字段和多字段的方法。通过具体的SQL语句示例,读者可以了解到如何有效地进行数据更新。

389

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



