有什么办法可以做这样的事情:

 select Name, sum(Exceptions) exceptions from Results i
 where exceptions > 0
 group by (Name)

我在计算出的求和字段中过滤掉所有为0的记录

我收到错误消息“无效使用聚合函数”

最佳答案

SELECT Name, SUM(Exceptions) AS exceptions
FROM Results AS r
GROUP BY (Name)
HAVING SUM(Exceptions) > 0

10-06 11:26