HAVING keyword is used to filter rows returned by GROUP BY keyword. GROUP BY statement must be used in order to use HAVING to filter.
Example: Select class score averages greater than the 60.
SELECT studentClass, AVG(grade) FROM studentGrades GROUP BY studentClass HAVING AVG(grade) > 60
No comments:
Post a Comment