select count(*) as U from (select count(*) as c from test.user group by b)as t where t.c >=2; select count(*) from (select count(*) from test.`user` group by b having count(*)>=2) as t ;
从数据库里查重复的记录大于2的记录个数
原文:http://blog.csdn.net/zhu_9527/article/details/18233053