A HAVING-style rule filters aggregate rows.

highlighted = computed this step

Keep or drop groups

A HAVING-style rule filters groups after the aggregate is computed.

aggregate first, filter second\text{aggregate first, filter second}

Apply the group filter

The table forms 3 groups and keeps 2 after the filter.

kept groups=2\text{kept groups}=2

Grouping examples are tiny finite table transforms; SQL dialects, NULLs, AVG/rounding, planner behavior, indexes, performance, and product behavior are out of scope.

Keep or drop groups: base rowssourceRowidkindqty01book212game123book334game445tool1 group by columnscolumnkind aggregate specsopcolumnassum_intqtytotal_qty group bucketskeysourceRowsrowCount[book][0, 2]2[game][1, 3]2[tool][4]1 aggregate rowskeytotal_qty[book]5[game]5[tool]1 having keep/dropkeystatusreason[book]keeppasses_having[game]keeppasses_having[tool]dropfails_having output rowskeytotal_qty[book]5[game]5 group factsfactvaluerowCount5groupByColumnCount1groupCount3aggregateCount1outputGroupCount2havingtotal_qty ge 5hiddenGroupsno

Read keep or drop

The having table shows which group passed the threshold and which group failed.

keep/drop is visible\text{keep/drop is visible}

Summary

This is a tiny aggregate threshold, not full SQL HAVING syntax.

scoped filter\text{scoped filter}