Question: I have a database with 2 copies of 25 of the several thousand rows. how can I execute a command to remove one of each of these? the table is a table containing 2 foreign keys.

example:

```
cID  |  sID
1    |  1
1    | 23
1    | 65
2    | 45
2    | 45 -> remove
2    | 89
3    |  1
3    |  65
3    | 107
   ...

```

Answer: 
One solution would be to create another table:

```
create table replacement (cID ...., sID ....);
# Only insert unique rows, which may be long
insert into replacement select distinct cID, sID from origtable;
# remove constraints from linked tables to origtable
# add same constraints to replacement
# add unique compound index on (cID,sID) to replacement
drop table origtable;
alter table replacement rename to origtable;

```

This supposes of course that your origtable only contains these two columns.
`SELECT DISTINCT` is your friend.