我需要一个查询来统计重复记录,
例如
table name -customer
===================
customer_id-col name
222
111
222
222
111
122产出将
customer_id count
222 3
111 2
222 3
222 3
111 2
122 1 我试过这个查询
从具有c >1的客户组中选择customer_id,计数( customer_id )c
输出是
customer_id计数
222 3
111 2
122 1 这有可能预先感谢吗?
谢谢拉贾
发布于 2014-03-06 10:09:54
select customer_id,count(1) as count
from customer
group by customer_idhttps://stackoverflow.com/questions/22221159
复制相似问题