--删除重复的记录
delete from table1
--根据Uid号获取重复的记录
where uid in (select uid from table1 group by uid having count(uid) > 1)
--排除保留最新的ID号,其他的删除
and id not in (select max(id) from table1 group by uid having count(uid )>1)
原文:http://www.cnblogs.com/huangtailang/p/4121012.html