I have a table which goes like this
c_id b_id
13 151
27 203
38 347
38 349
38 357
72 132
72 475
104 14
151 22
207 690
207 712
As you can see the table is ordered first by c_id and then by b_id. I would like to remove the first entry for every c_id.
So my output table should be this
c_id b_id
38 349
38 357
72 475
207 712
The c_ids which have just one b_id associated with them have been removed. And the first b_ids for the other c_ids have been removed.
Multiple queries can be used. There are millions of rows in the original table.
This should give you the following:
Live Demo