如何使用PHPMyAdmin在MySQL中删除重复的行? [英] How do I remove duplicate rows in MySQL using PHPMyAdmin?

查看:462
本文介绍了如何使用PHPMyAdmin在MySQL中删除重复的行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个名为"master_database"的数据库和一个名为"info"的表

I have a database called 'master_database' and a table called 'info'

在"info"表中,我有多个记录,并且我需要"email"字段中不包含任何重复项,但目前确实如此.我可以运行什么SQL命令删除这些重复项?

In the 'info' table I have multiple records and I need the 'email' field to not contain any duplicates but currently it does. What SQL command can I run to remove these duplicates?

推荐答案

您可以使用以下方法了解重复的行:

You can know the rows that are repeated by using this:

SELECT email, COUNT(email) FROM info GROUP BY email HAVING COUNT(email) > 1 

这篇关于如何使用PHPMyAdmin在MySQL中删除重复的行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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