Skip to content

Non-grouping field 'visits' is used in HAVING clause ERROR #4 #16

@hackerDEpandas

Description

@hackerDEpandas

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions