Multiple choice technology databases

Which CLAUSE is used in a SELECT statement to filter the records that a GROUP BY returns?

  1. WHERE

  2. HAVING

  3. HAVING BY

  4. ORDER BY

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

The HAVING clause is specifically designed to filter groups after the GROUP BY operation has aggregated the data. The WHERE clause filters individual rows before grouping, which is why it cannot be used with aggregate functions. HAVING BY and ORDER BY are not filtering clauses for grouped data.