1.首先是确认数据没有重复
select count(*) as repeat_count,`ID`,`name` from student
group by `ID` having repeat_count > 1;
2.查看本表和另外一张表是否有ID相同
SELECT count(1) FROM `student01`
WHERE `ID` IN (SELECT `ID` FROM `student02`);
3.然后是可以把另外一张表的数据导入到这张表中(更新update)
UPDATE `student01` lopr JOIN `student02` n ON lopr.order_num=n.`ID`
SET lopr.`name` = n.`name`;
4.然后是可以把另外一张表的数据导入到这张表中(插入insert)
INSERT INTO `student01` (SELECT `ID`,`name` FROM `student02`);