第一步:先把需要查询的数据列出来
select UUID(), a.Code, a.Name,a.Continent from country a, countrylanguage b where a.Code = b.CountryCode;
注意:UUID()不要分割,分割后,uuid相同
第二步:把数据插入到表中
insert into temptable (id,code,name,continent) (
select UUID(), a.Code, a.Name,a.Continent from country a, countrylanguage b where a.Code = b.CountryCode
);
第三步:更新UUID,将“ - ”替换掉
update TEMPTABLE set id =select REPLACE(id,'-','')
OK,搞定
o