Mysql查询重复字段

版权声明:本文为博主原创文章,欢迎转载,转载时请以超链接形式标明文章原始出处。 https://blog.csdn.net/lilongsy/article/details/84766650

查询category表中,catname字段值重复的数据及重复次数

select catname, count(*) as count 
from category 
group by catname 
having count>1

猜你喜欢

转载自blog.csdn.net/lilongsy/article/details/84766650