group by:
select WhCode, BillType, SUM(currQuantity) Qty from bcStockRecord
group by WhCode, BillType
select WhCode, BillType, SUM(currQuantity) Qty from bcStockRecord
group by WhCode, BillType with rollup
select WhCode, BillType, SUM(currQuantity) Qty from bcStockRecord
group by WhCode, BillType with cubeselect WhCode,GROUPING(WhCode), BillType,GROUPING(BillType), SUM(currQuantity) Qty from bcStockRecord
group by WhCode, BillType with cube
本文介绍了使用SQL进行分组查询的几种方法,包括基本的GROUP BY语句、WITH ROLLUP选项以及WITH CUBE选项。这些方法可以帮助用户根据不同维度汇总数据,并通过GROUPING函数展示ROLLUP和CUBE的效果。
481

被折叠的 条评论
为什么被折叠?



