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なら以上
![[MySQL]重複行の削除 | もろもろメモ](https://cdn-ak-scissors.b.st-hatena.com/image/square/7e29a5c6adfb101f71ec82a19eccbf8ee66a2f35/height=288;version=1;width=512/https%3A%2F%2Fpds.exblog.jp%2Flogo%2F1%2F200407%2F29%2F16%2Fb000471620050502000029.jpg)