SELECT category, SUM(fee) FROM tblproducts /* optional where clause */ GROUP BY category