create table t1(id int null,data int null)
create table t2(id int null,data int null)
insert into t1 values(1,2)
insert into t2 values(1,3)
update t1 set t1.data=data
where t1.id in (select t2.id from t2)
为什么这样就不行呢?
update t1 set t1.data=t2.data
where t1.id in (select t2.id from t2)
where t1.id in (select t2.id from t2)
本文探讨了使用SQL语句更新两个关联表数据的方法,并通过具体示例解释如何正确设置更新条件,确保数据的一致性和准确性。
1015

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



