update test1 a set a.name=(select b.name from test2 b where a.id=b.id) where a.id in (select id from test2);