将查出来的B表的名字设置为A表的名字ID相同的 update A inner join (select id,name from B) c on A.id = c.id set A.name = c.name;