I have the following table:
where the products are in different categories and i am excepting
Using Rollup you would do it like this.
SELECT COALESCE(product,category,'Total') Category, SUM(VALUE) cost FROM products GROUP BY ROLLUP(category,product)