从mysql中的表中删除重复数据

时间:2013-11-06 08:33:10

标签: mysql

我不知道如何删除表中的所有重复数据,我不知道哪个数据在我的表中是重复哪个查询我可以在Mysql中运行请帮帮我

delete from tablename(record) where coluumnname(employer)=ram >0

它工作但它删除表中的所有记录不重复

2 个答案:

答案 0 :(得分:1)

一般..

delete from <table_name> where rowid not in 
                       ( select min(rowid) 
                         from table group by column1..,column2,...column3..);

在你的情况下

delete from table where employer not in 
   (select min(employer) from table group by employer order by 1);

答案 1 :(得分:0)

从雇员='ram'限制1

的记录中删除
相关问题