CUBE, ROLLUP in SQL Server

Опубликовано: 15 Октябрь 2024
на канале: IT Port
919
5

Click here to Subscribe to IT PORT Channel :    / @itport28  

These operators are used with the GROUP BY clause and allow you to create subtotals, grand totals and superset of subtotals

The ROLLUP operator is used with the GROUP BY clause. It is used to create subtotals and grand totals for a set of columns. The summarized amounts are created based on the columns passed to the ROLLUP operator

The CUBE operators, like the ROLLUP operator produces subtotals and grand totals as well. But unlike the ROLLUP operator it produces subtotals and grand totals for every permutation of the columns provided to the CUBE operator