表,单字段重复删除
delete
from student
where id not in(
select a.id
from ((select min(id) id
from student
group by (name))a));
表中,多字段重复 匹配删除数据,
创建一个临时表tmp,存入最大id一个数据,数据唯一
删除不是tmp表id其他所有值
删除临时tmp表
create table tmp as select kemu ,stu_id,max(id) as co from score group by kemu,stu_id;
delete from score where id not in(select co from tmp);
drop table tmp;