- Notifications
You must be signed in to change notification settings - Fork689
Cube
Mathias Rangel Wulff edited this pageJun 12, 2015 ·4 revisions
AlaSQL supports CUBE() grouping options:
vartestData=[{Phase:"Phase 1",Step:"Step 1",Task:"Task 1",Val:5},{Phase:"Phase 1",Step:"Step 2",Task:"Task 2",Val:20},{Phase:"Phase 2",Step:"Step 1",Task:"Task 1",Val:25},{Phase:"Phase 2",Step:"Step 2",Task:"Task 2",Val:40}];res=alasql('SELECT Phase, Step, SUM(Val) AS Val FROM ? \ GROUP BY CUBE(Phase,Step)',[testData]);
Try this examplein jsFiddle
See also:ROLLUP, [GROUPING SETS](Grouping Sets), [GROUP BY](Group By)
© 2014-2026,Andrey Gershun &Mathias Rangel Wulff
Please help improve the documentation by opening a PR on thewiki repo