1、查詢表中多餘的重複記錄,重複記錄是根據單個欄位(peopleId)來判斷複製程式碼程式碼如下:select * from peoplewhere peopleId in (select peopleId from people group by peopleId having count(peopleId) > 1)2、刪除表中多餘的重複記錄,重複記錄是根據單個欄位(peopleId)來判斷,只留有rowid最小的記錄複製程式碼程式碼如下:delete from people where peopleId in (select peopleId from people group by peopleId having count(peopleId) > 1)and rowid not in (select min(rowid) from people group by peopleId having count(peopleId)>1)
1、查詢表中多餘的重複記錄,重複記錄是根據單個欄位(peopleId)來判斷複製程式碼程式碼如下:select * from peoplewhere peopleId in (select peopleId from people group by peopleId having count(peopleId) > 1)2、刪除表中多餘的重複記錄,重複記錄是根據單個欄位(peopleId)來判斷,只留有rowid最小的記錄複製程式碼程式碼如下:delete from people where peopleId in (select peopleId from people group by peopleId having count(peopleId) > 1)and rowid not in (select min(rowid) from people group by peopleId having count(peopleId)>1)