Group By?

This is a total RT n00b question. The Query Builder can’t do any sort
of SUM or GROUP BY aggregate functions? What’s the easiest way to do
this, through a Perl script?

Thanks,
Michael