We have a table of photos with the following columns:
id, merchant_id, url
this table contains duplicate values for the combination merchant_id, url
. so it's possible that one row appears more several times.
234 some_merchant http://www.some-image-url.com/abscde1213
235 some_merchant http://www.some-image-url.com/abscde1213
236 some_merchant http://www.some-image-url.com/abscde1213
What is the best way to delete those duplications? (I use PostgreSQL 9.2 and Rails 3.)