DELETEFROM peopleWHERE 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)