I am trying to use
OFFSET to return the duplicated IDs, but there is a problem:
I can't figure out the number after the
LIMIT. It should be the number of rows in that group minus 1, but how should I write it?
delete from Person where Id in ( select b.Id from Person b group by b.Email having count(*) > 1 order by b.Id asc limit count(*)-1 offset 1 )