删除数据库重复数据

来源:互联网 发布:网络直播是什么意思 编辑:程序博客网 时间:2024/05/14 02:55

delete from tablename where id not in (select max(id) from tablename group by column1,column2...)

其中tablename为要操作的表,id为假设的表中某一唯一字段,column1~2...为表中的列,关键是group by


还可以间隔临时表,但是那样就太麻烦,复杂了!


原创粉丝点击