Analyzes a set of data across a single dimension with more than one level of detail.
ANSI Compliance
ROLLUP is ANSI SQL:2011 compliant.
SAMPLE Clause and ROLLUP
You cannot specify a SAMPLE clause in a query that also specifies the ROLLUP option in a GROUP BY clause, with the exception of a query where the ROLLUP option in the GROUP BY clause is specified in a derived table or a view, and the SAMPLE clause is specified in the outer query.
How ROLLUP Summarizes Data
Given n column references, ROLLUP groups data at n levels of detail in one dimension. For example, in Example: Basic ROLLUP, the GROUP BY clause rolls up over three columns and reports three levels of control breaks.