MySQL中在原表中做数据去重(按日期去重,保留id最小的记录)

表名称

code600300

delete from code600300 where id not in (select minid from (select min(id) as minid from code600300 group by date) b);

原文地址:https://www.cnblogs.com/curious2017/p/6322666.html