17,377
社区成员
发帖
与我相关
我的任务
分享
update t_table a
set (f1, f2, f3) =
(select f1, f2, f3 from testz b where a.id = b.id)
where exists (select 1 from testz b where a.id = b.id)
[/quote]
你的回复是正确的,怎么理解这个事情?[/quote]
没有带where条件,那肯定是全表更新了。
(select f1, f2, f3 from testz b where a.id = b.id)
这个只是代表能不能更新到值,找不到肯定就会置空。
跟表需要更新多少数据是没有直接关系的。
update t_table a
set (f1, f2, f3) =
(select f1, f2, f3 from testz b where a.id = b.id)
where exists (select 1 from testz b where a.id = b.id)
[/quote]
你的回复是正确的,怎么理解这个事情?update t_table a
set (f1, f2, f3) =
(select f1, f2, f3 from testz b where a.id = b.id)
where exists (select 1 from testz b where a.id = b.id)
update t_table a
set (f1,f2,f3)=(select f1,f2,f3 from testz b )
where a.id=b.id