比如,某个表要按照id和name重复,就算重复数据
delete from 表名 where rowid not in (select min(rowid) from 表名 group by id,name);
commit;
如果以id,name和grade重复算作重复数据
delete from 表名 where rowid not in (select min(rowid) from 表名 group by id,name,grade);
commit;
注意 min也可以换成max
2023-08-23 14:07:04
比如,某个表要按照id和name重复,就算重复数据
delete from 表名 where rowid not in (select min(rowid) from 表名 group by id,name);
commit;
如果以id,name和grade重复算作重复数据
delete from 表名 where rowid not in (select min(rowid) from 表名 group by id,name,grade);
commit;
注意 min也可以换成max