GROUP BY using HAVING

suggest change
SELECT department, COUNT(*) AS "Man_Power"
FROM employees
GROUP BY department
HAVING COUNT(*) >= 10;

Using GROUP BY ... HAVING to filter aggregate records is analogous to using SELECT ... WHERE to filter individual records.

You could also say HAVING Man_Power >= 10 since HAVING understands “aliases”.

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents