行が重複しているテーブルをクリーンアップする必要があります。
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
テーブル全体に対して 1 つのクエリを実行し、とurl
が重複しているすべての行を削除したいと考えています。上記のサンプルでは、削除後に 1、2、4、および 5 だけを残したいと考えています。