一些sqlite语句

1、查找表中多余的重复记录(多个字段)
select * from test group by column1, column2, column3 having count(*)>1

2、删除表中多余的重复记录(多个字段),只留有rowid最小的记录
delete from test where test.rowid not in (select min(test.rowid) from test group by column1, column2, column3)

你可能感兴趣的:(一些sqlite语句)