How to display products under Category in sql in a table

后端 未结 3 1209
轮回少年
轮回少年 2021-01-28 05:48

I have the following table:

\"product\"

where the products are in different categories and i am excepting

3条回答
  •  無奈伤痛
    2021-01-28 06:37

    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))
    

提交回复
热议问题