Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

GROUP BY and HAVING πŸ“

Learning Goals

By the end of this section you will:

  • know how use the GROUP BY clause to perform aggregation calculations on subgroup within the results.

  • know how to filter the grouped results using the HAVING clause.

GROUP BY Clause πŸ“ΒΆ

The SQL GROUP BY statement is used to group rows that have the same values in specified columns into summary rows, often in conjunction with aggregate functions to perform calculations on each group. While the SQL HAVING statement is used to filter groups of rows created by the GROUP BY clause based on specified conditions, typically involving aggregate functions.

Go to the W3schools Tutorial on the GROUP BY Statement and complete thier exercises.

HAVING ClauseΒΆ

The HAVING clause is used to filter groups of records created by the GROUP BY clause based on a specified condition.

Go to the W3schools Tutorial on the HAVING Clause and complete their exercises.