delete from yld1 where id is null; delete from yld2 where id is not null; alter table yld1 add autoid int not null AUTO_INCREMENT primary key; alter table yld2 add autoid int not null AUTO_INCREMENT primary key;
update yld1 as a,yld2 as b set a.uid = b.uid where a.autoid = b.autoid;