The HAVING Clause

In this lesson, we will learn about the HAVING clause.

We'll cover the following...

The HAVING clause

The HAVING clause is utilized in SQL as a conditional clause with the GROUP BY clause. This conditional clause only returns rows where aggregate function results are matched with given conditions.

The HAVING clause was added to SQL because the WHERE keyword could not be used with aggregate functions.

Syntax

The basic syntax of the HAVING clause is as follows:

 ...