#//把所有数据插入到备用数据表
INSERT into student_copy1 select * from student;
#//清空student数据表
delete from student;
#//把筛选后的数据存入student数据表
#//筛选出重复数据中id最大的数据
insert into student select * from student_copy1 where idcard in(Select idcard From student_copy1 Group By idcard Having Count(idcard)>1) and id in(Select MAX(id) From student_copy1 Group By idcard Having Count(idcard)>1);
#//筛选出没有重复的数据
insert into student select * from student_copy1 where idcard not in(Select idcard From student_copy1 Group By idcard Having Count(idcard)>1);
#//清空备用数据表
delete from student_copy1;