Total Pageviews

WITH ROLLUP in SQL Server



  • ROLLUP operator helps us to get the sub-totals and totals.
  • Main benefit of ROLLUP is, it generates a result set that shows aggregates for a hierarchy of values in the selected columns.
  • ROLLUP operator starts working from granule level. In other words, ROLLUP operator first applies the aggregate function (used in query) to individual record then on group of records then on total records.
For example:-



Below will be the result :-



 

No comments:

Post a Comment