如何删除PHP/Mysql中的所有重复记录 [英] How to delete all the duplicate records in PHP/Mysql

查看:184
本文介绍了如何删除PHP/Mysql中的所有重复记录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可能重复:
如何删除mysql数据库中的重复记录?

Possible Duplicate:
How to delete duplicate records in mysql database?

在mysql表中有重复的行. 如何找到重复的行并删除它们.

there are duplicate rows in the mysql table. how find the duplicate rows and delete them.

推荐答案

DELETE * ,count(*)as n FROM add group by id HAVING n>1.

它将删除所有重复的记录

It will delete all duplicate records

这篇关于如何删除PHP/Mysql中的所有重复记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆