最佳答案
此 sql 代码引发一个
在 WHERE 中不允许使用聚合函数
SELECT o.ID , count(p.CAT)
FROM Orders o
INNER JOIN Products p ON o.P_ID = p.P_ID
WHERE count(p.CAT) > 3
GROUP BY o.ID;
我如何避免这个错误?