This sql code throws an
aggregate functions are not allowed in WHERE
SELECT o.ID , count(p.CAT) FROM Orders o INNER JO
Use HAVING clause instead of WHERE
HAVING
WHERE
Try this:
SELECT o.ID, COUNT(p.CAT) cnt FROM Orders o INNER JOIN Products p ON o.P_ID = p.P_ID GROUP BY o.ID HAVING cnt > 3