# `StreamAgg` Process

+ Sorted by the grouping column **`Department`** first
![`smart`](STREAMAGG01_aa_003_20231013.png)

------------------------------------------------------------------------------
In the slide, the table is first sorted by the grouping column `Dept.`, and then the entire table is scanned, aggregating rows with the same `Dept.` into a single row in a temporary table.
