I have the following table:
where the products are in different categories and i am excepting
Maybe something like this... doesn't give your exact output but it's close...
Select category, product, sum(value) as value From TableName group by grouping sets ((category),(category, product))