Reputation: 137
I'm doing like this :
SELECT salary COUNT(salary ) AS NumberOfTimes
FROM person
GROUP BY salary
HAVING (COUNT(salary) > 1)
Upvotes: 0
Views: 9588
Reputation: 1074989
Other than a missing comma after the first salary
, what you have is fine. You don't need the parentheses around your HAVING
clause, but I can't imagine the parser cares:
SELECT salary, COUNT(salary) AS NumberOfTimes
FROM person
GROUP BY salary
HAVING COUNT(salary) > 1
Upvotes: 2