SQL Server的Cube操作符使用详解
|
源代码网整理以下SQL Server的Cube操作符使用详解 源代码网整理以下select productid,orderid SUM(quantity) AS total FROM order GROUP BY productid,orderid WITH CUBE 源代码网整理以下ORDER BY productid,orderid 源代码网整理以下运行后得到结果: 源代码网整理以下productid orderid total 源代码网整理以下null null 95 所有定单所有产品总量 源代码网整理以下null 1 30 定单1所有产品数量 源代码网整理以下null 2 65 定单2所有产品数量 源代码网整理以下1 null 15 所有定单产品1总量 源代码网整理以下1 1 5 定单1产品1数量 源代码网整理以下1 2 10 定单2产品1数量 源代码网整理以下2 null 35 所有定单产品2总量 源代码网整理以下2 1 10 定单1产品2数量 源代码网整理以下2 2 25 定单2产品2数量 源代码网整理以下3 null 45 所有定单产品3总量 源代码网整理以下3 1 15 定单1产品3数量 源代码网整理以下3 2 30 定单2产品3数量 源代码网整理以下 源代码网整理以下 我想电子商务可以更好的实现合理配置资源,尽量减少库存,只有更好的掌握生产、销售数据的具体情况,才能实现资源的合理配置。希望以后的企业象dell一样,不要象长虹等彩电厂商。 源代码网供稿. |
