I have to clean a table with duplicate rows:
id: serial id
gid: group id
url: string <- this is the column that I have to cleanup
One gid
may have multiple url
values:
id gid url
---- ---- ------------
1 12 www.gmail.com
2 12 www.some.com
3 12 www.some.com <-- duplicate
4 13 www.other.com
5 13 www.milfsome.com <-- not a duplicate
I want to execute one query against the entire table and delete all rows where the gid
and url
are duplicate. In the above sample, after the delete, I want to have only 1, 2, 4 and 5 remaining.