# HAVING

A clause filtering groups after grouping and aggregation.

## What is **HAVING** in a relational database?

**HAVING** — A clause filtering groups after grouping and aggregation.

```sql
SELECT customer_id, COUNT(*) AS order_count
FROM purchase_order
GROUP BY customer_id
HAVING COUNT(*) >= 3;
```

Level: Apprentice · [More Database terms at this level](https://www.ask-codey.com/glossary/subjects/database/apprentice)

Updated: September 27, 2026

Source: https://www.ask-codey.com/glossary/having
