UPDATE testA a INNER JOIN testB b on a.id = b.idset a.`status` = b.`status`,a.update_time = b.update_timewhere b.`status` != 2 ;