查询某个字段重复的sql:

来源:互联网 发布:迷幻p图软件 编辑:程序博客网 时间:2024/06/05 18:58
方法1:
select a.name from user a where a.name in
(select b.name from user b group by b.name having count(*) > 1)
方法2:
select a.name ,count(1) from user a
group by a.name having count(1) > 1 order by count(1) desc;