我需要清理一张有重复行的表格:
id: serial id
gid: group id
url: string <- this is the column that I have to cleanup
一个
gid
可以有多个 url
值: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
我希望执行一条查询来删除整个表中所有gid
和url
重复的行。在上面的示例中,删除后,我只想留下1、2、4和5。