Полагаю, имя таблицы - foobar, а c1 и c2 не обнуляются.
этот запрос выберет дубликат
select d.* from ( select c1 ,c2 , count(*) as cnt , min(id) as mid from foobar group by c1,c1 ) as e
join foobar d on d.c1=e.c1 and d.c2=e.c2 and d.id > e.mid ;
Вы должны создать временную таблицу со списком всех идентификаторов, которые хотите удалить.
create table bad_id_foobar as select d.id from ( select c1 ,c2 , count(*) as cnt , min(id) as mid from foobar group by c1,c1 ) as e
join foobar d on d.c1=e.c1 and d.c2=e.c2 and d.id > e.mid ;
этот запрос удалит дубликат
delete from foobar where id in ( select b.id from bad_id_foobar b );