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;
精彩评论