data_tableからdateとtypeが重複している行を削除 delete data_table from data_table inner join ( select id from data_table inner JOIN ( select date,type from ( select id,count(*) c,date,type from data_table group by date,type) as u where u.c = 2 ) res ON data_table.date = res.date AND data_table.type = res.type ) d ON d.id = data_table.id u.c = 2なので、2件のものを削除 uc >= 2なら以上