Home >Database >Mysql Tutorial >mysql 数据表中查找重复记录

mysql 数据表中查找重复记录

WBOY
WBOYOriginal
2016-06-07 18:01:381138browse

以下sql语句可以实现查找出一个表中的所有重复的记录

代码如下:
select user_name,count(*) as count from user_table group by user_name having count>1;

这个我在很早有发过一个asp下的ACCESS 的
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:MySQL 随机密码生成代码Next article:找到MySQL的优点