MySQL query - using SUM of COUNT

后端 未结 5 933
刺人心
刺人心 2021-01-07 16:27

This query:

SELECT COUNT(source) AS count
FROM call_details
GROUP BY source
HAVING count >1

Returns about 1500 (the number I\'m looking

5条回答
  •  悲&欢浪女
    2021-01-07 16:57

    Try this

    select mycount, sum(mycount) as sumcount
    from
    (SELECT COUNT(source) AS mycount FROM call_details GROUP BY source HAVING mycount >1)   counttable 
    

提交回复
热议问题