删除SQLite中的重复数据

查询Table中id字段重复的行:

1
select * from Table group by id having count(*)>1;

删除Table中id字段重复的行:

1
delete from Table where Table.rowid not in (select max(Table.rowid) from Table group by id);

关于group by可以参考这里:http://www.runoob.com/sqlite/sqlite-group-by.html

关于rowid可以参考这里http://sqlite.org/lang_createtable.html#rowid