我这样做:
SELECT salary COUNT(salary ) AS NumberOfTimes
FROM person
GROUP BY salary
HAVING (COUNT(salary) > 1)
答案 0 :(得分:2)
除了第一个salary
之后缺少的逗号,你所拥有的就好了。你不需要围绕HAVING
子句的括号,但我无法想象解析器在乎:
SELECT salary, COUNT(salary) AS NumberOfTimes
FROM person
GROUP BY salary
HAVING COUNT(salary) > 1
答案 1 :(得分:0)
在“salary”和“COUNT(salary)”之间添加逗号。