SELECT *FROM table WHERE id NOT IN ( SELECT temp.mid FROM ( SELECT min( id ) AS mid FROM table em GROUP BY em.cid, em.mem_id ) AS temp );复制代码
删除重复数据只保留一条
DELETE FROM gm_vip_member WHERE id NOT IN ( SELECT temp.mid FROM ( SELECT min( id ) AS mid FROM gm_vip_member em GROUP BY em.cid, em.mem_id ) AS temp );复制代码