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):如果没有这个条件,不匹配的选项也会被更新。
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):如果没有这个条件,不匹配的选项也会被更新。