Non-grouping field 'visits' is used in HAVING clause ERROR #4
Opened this issue · 0 comments
hackerDEpandas commented
The query as is throws the above error. I fixed it with the following syntax:
SELECT company, num, COUNT(*) AS visits
FROM route WHERE stop=149 OR stop=53
GROUP BY company, num
HAVING COUNT(*)=2