我正在使用SAP Hana,并希望将数据汇总到类别中。另外,显示子类别的数据。
计算总计
示例:- 因此,根据我的查询,当前我的数据如下所示:
category | sub_category | count
------------+----------------------+--------
Grocery | Dairy | 200
Grocery | fruits | 600
Kitchen | Microwave | 100
Kitchen | Stove | 100
Other | shoes | 400
Other | racks | 500
我想要的是:
category | sub_category | count
-------------+----------------------+--------
Grocery | Dairy | 200
Grocery | fruits | 600
Total Grocery| null | 800
Kitchen | Microwave | 100
Kitchen | Stove | 100
Total Kitchen| null | 200
Other | shoes | 400
Other | racks | 500
Total Other | null | 900