2

下面是我正在编写的查询,但由于某种原因,它在“ROLLUP”这个词之后给了我一个语法错误,红色的小波浪线在“(”之后)在汇总之后。

SELECT building, room_number, time_slot_id, COUNT(*)
FROM class1
GROUP BY ROLLUP (building, room_number, time_slot_id)
4

1 回答 1

4

你需要With Rollupgroup by. 试试这个语法

SELECT building, room_number, time_slot_id, COUNT(*)
FROM class1
GROUP BY building, room_number, time_slot_id WITH ROLLUP 

欲了解更多信息,请查看此处

于 2015-02-13T01:43:30.733 回答