update tmp t set t.name=(select t2.name from tmp2 t2 where t2.idcard=t.idcard) where exist (select 1 from tmp2 t2 where t2.idcard=t.idcard)