Is an aggregate function that causes an additional column to be output with a value of 1 when the row is added by either the CUBE or ROLLUP operator, or 0 when the row is not the result of CUBE or ROLLUP?
Grouping is allowed only in the select list associated with a GROUP BY clause that contains either the CUBE or ROLLUP operator.CUBE and ROLLUP function is useful for generating reports. If you’re just doing a simple GROUP BY, with just one GROUP, or multiple GROUPS but with only one possible combination, than use a ROLLUP. The ROLLUP will eliminate showing any values with NULL in the first column.
http://www.sql-programmers.com/Blog/tabid/153/EntryId/7/Summarizing-Data-with-CUBE-and-ROLLUP.aspx
No comments:
Post a Comment