特殊的分组问题(20分)
SQL SERVER 2000中的 CUBE 或 ROLLUP 分组函数在Access中对应的是那个函数?
SELECT Item, Color, SUM(Quantity) AS QtySum
FROM Inventory
GROUP BY Item, Color WITH CUBE
下面是结果集:
Item Color QtySum
-------------------- -------------------- --------------------------
Chair Blue 101.00
Chair Red 210.00
Chair (null) 311.00
Table Blue 124.00
Table Red 223.00
Table (null) 347.00
(null) (null) 658.00
(null) Blue 225.00
(null) Red 433.00
NULL值的行注意了:第三行是第一和第二行的小计... ...
问题点数:20、回复次数:2Top
1 楼liuyann(liuyann)回复于 2004-12-03 20:47:37 得分 20
SELECT Item, Color, SUM(Quantity) AS QtySum
FROM Inventory
group by Item, Color
unoin
select Item, "total", SUM(Quantity) AS QtySum
FROM Inventory
group by Item, "total"
Top
2 楼wangtiecheng(不知不为过,不学就是错!)回复于 2004-12-03 21:22:14 得分 0
ding!Top




