Mysql 删除重复数据只保留id最小的

DELETE FROMWHERE id NOT IN ( SELECT id FROM ( SELECT min(b.id) AS id FROM 表 b GROUP BY b.重复字段 ) b )

 

posted @ 2017-09-28 11:17  曲高终和寡  阅读(442)  评论(0编辑  收藏  举报