列出相同的数据记录
SELECT Count(FieldName),Max(FieldName) FROM TableName GROUP BY FieldName HAVING Count(FieldName)>1
找出相同的记录,然后删除id号小的那个记录,例如:删除octopus_page_page表中keyWord相同的记录中id号小的那条记录
create table tmp as select min(id) as col1 from octopus_page_page group by `keyWord` having count(`keyWord` )>1;
delete from octopus_page_page where id in (select col1 from tmp);
drop table tmp;
以上我在生产环境中用过,嘿嘿,么问题啦。