ROLLUP Grouping Set Option - Teradata Database - Teradata Vantage NewSQL Engine

SQL Data Manipulation Language

Product
Teradata Database
Teradata Vantage NewSQL Engine
Release Number
16.20
Published
March 2019
Language
English (United States)
Last Update
2019-05-03
dita:mapPath
fbo1512081269404.ditamap
dita:ditavalPath
TD_DBS_16_20_Update1.ditaval
dita:id
B035-1146
lifecycle
previous
Product Category
Teradata Vantage™

Purpose

Analyzes a set of data across a single dimension with more than one level of detail.

Syntax



Syntax Elements

ordinary_grouping_set
One or more expressions used to group rolled up report rows across a single dimension.
The expression cannot group result rows that have a BLOB, CLOB, ARRAY, or VARRAY type.
All ordinary grouping sets must make explicit column references. You cannot specify column positions with ROLLUP.
Rolling up over a single column is equivalent to a simple GROUP BY on that same column.
You cannot specify more than 190 columns in the ordinary grouping sets.
You cannot reference columns that have a LOB data type unless they are first CAST to another data type or passed to a function whose result is not a LOB. For example, casting a BLOB to BYTE or VARBYTE or casting a CLOB to CHARACTER or VARCHAR.

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.