Help for this page
select category||type as grp, max(category) as cat, max(type) as typ, sum(quantity) as qty from table group by category || type
sub group_by { my ($rows, $group_keys) = @_; ... } return @recs; }