tags:

views:

50

answers:

3

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 but I didn't get anywhere.

A: 
SELECT DISTINCT `commenter_name` FROM `comments`
Andrey
OP wants `how many total unique callers` and not each unique caller
KM
+6  A: 
SELECT COUNT(DISTINCT 'commenter_name') FROM 'comment';
Dan
A: 

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

Iser