下面是我正在编写的查询,但由于某种原因,它在“ROLLUP”这个词之后给了我一个语法错误,红色的小波浪线在“(”之后)在汇总之后。
SELECT building, room_number, time_slot_id, COUNT(*)
FROM class1
GROUP BY ROLLUP (building, room_number, time_slot_id)
下面是我正在编写的查询,但由于某种原因,它在“ROLLUP”这个词之后给了我一个语法错误,红色的小波浪线在“(”之后)在汇总之后。
SELECT building, room_number, time_slot_id, COUNT(*)
FROM class1
GROUP BY ROLLUP (building, room_number, time_slot_id)
你需要With Rollup
在group by
. 试试这个语法
SELECT building, room_number, time_slot_id, COUNT(*)
FROM class1
GROUP BY building, room_number, time_slot_id WITH ROLLUP
欲了解更多信息,请查看此处