开发者

Count total number of callers?

开发者 https://www.devze.com 2022-12-23 06:11 出处:网络
I\'m currently doing this query to find the guy who makes the most calls: SELECT `commenter_name`, COUNT(*) AS `calls`

I'm currently doing this query to find the guy who makes the most calls:

SELECT 
    `commenter_name`, 
    COUNT(*) AS `calls` 
FROM `comments` 
GROUP BY `commenter_name` 
ORDER BY `calls` LIMIT 1

What I want now is to be able to find out how many total unique callers. I tried using DISTINCT开发者_JS百科 but I didn't get anywhere.


SELECT COUNT(DISTINCT 'commenter_name') FROM 'comment';


SELECT DISTINCT `commenter_name` FROM `comments`


Select Count(*) From (Select DISTINCT commenter_name from comment) as CmtCnt;

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号