Try:
SELECT EMPLOYER, COUNT (STUDENT_ID)
FROM STUDENT
GROUP BY EMPLOYER
HAVING COUNT (STUDENT_ID) >4;
- this will return a list of all employers with more than 4 students.
When grouping or including aggregated fields, your select statement should only include fields that are either aggregated or included in the group by
clause - in your existing select, you are including EMPLOYER
in your select clause, but not grouping by it or aggregating it.