CUBE Option Syntax | SQL SELECT Statements | Teradata Vantage - CUBE Option Syntax - Analytics Database - Teradata Vantage

SQL Data Manipulation Language

Deployment
VantageCloud
VantageCore
Edition
Enterprise
IntelliFlex
VMware
Product
Analytics Database
Teradata Vantage
Release Number
17.20
Published
June 2022
ft:locale
en-US
ft:lastEdition
2025-04-02
dita:mapPath
pon1628111750298.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
esx1472246586715
lifecycle
latest
Product Category
Teradata Vantageā„¢
CUBE { ordinary_grouping_set | (ordinary_grouping_set) }

Syntax Elements

ordinary_grouping_set
one or more expressions used to group cubed report rows across multiple dimensions.
All ordinary grouping sets must make explicit column references. You cannot specify column positions with CUBE.
You cannot specify more than 8 columns in the ordinary grouping sets.
This limit is actually on the number of table dimensions that can be cubed. The value is much smaller than the limits for the ROLLUP and GROUPING SETS options because it specifies a limit of 28, or 256 different combinations of columns, not just columns.
You cannot reference columns that have a LOB data type unless they are first CAST to another type or passed to a function whose result is not a LOB. For example, casting a BLOB to BYTE or VARBYTE or a CLOB to CHARACTER or VARCHAR.