2

below is the query I am writing, but for some reason it gives me a syntax error right after the word 'ROLLUP' the little red squiggle line is under the ' ( ' after rollup.

SELECT building, room_number, time_slot_id, COUNT(*)
FROM class1
GROUP BY ROLLUP (building, room_number, time_slot_id)
beau8008
  • 49
  • 1
  • 7

1 Answers1

4

You need to use With Rollup in group by. Try this syntax

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

for more info check here

Pரதீப்
  • 91,748
  • 19
  • 131
  • 172