delete from student a where exists (select 1 from student b where b.stuName=a.stuName and (b.stuID<a.stuID or (b.stuID=a.stuID and b.rowid<a.rowid)) );
不知道你怎么算重复的记录,假定三个字段,每个字段的值都一样才算重复。 delete from student where rowid not in (select max(rowid) from student group by stuID, stuName, stuAge);
delete from student where rowid not in (select max(rowid) from student group by stuID, stuName, stuAge);
where exists (select 1 from student b
where b.stuName=a.stuName
and (b.stuID<a.stuID
or (b.stuID=a.stuID and b.rowid<a.rowid))
);
delete from student where rowid not in (select max(rowid) from student group by stuID, stuName, stuAge);