GROUP BY
Aggregate
Filters

orders (input)

idcustomeritemprice

result (output)

Colours show which pile each row lands in. Struck-through rows were removed by WHERE before any grouping happened.