Ordinary Grouping Set Expressions - 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
Language
English (United States)
Last Update
2024-04-05
dita:mapPath
pon1628111750298.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
esx1472246586715
lifecycle
latest
Product Category
Teradata Vantage™

The following table provides the definitions for the valid ordinary grouping set expressions you can specify in a GROUP BY clause.

Ordinary Grouping Set Expression                                                         Definition
column_name Set of column names drawn from the list of tables specified in the FROM clause of the SELECT statement that is used in the GROUP BY clause to specify the columns by which data is to be grouped.

The maximum number of columns you can specify is 64.

You cannot include LOB columns in the grouping expression.

You can specify a column_name_alias instead of column_name as long as it does not have the same name as a physical column in the table definition. In this case, you must specify column_position, not column_name_alias.

column_position Sequential numeric position of columns within the column_list clause of the SELECT statement that is used in the GROUP BY clause to specify the order by which data is to be grouped.

The value you specify must be a positive constant integer literal with a value between 1 and the number of columns specified in the select list, inclusive. Note thatVantage treats macro and procedure parameters as expressions, not as the specification of a column position.

You cannot include LOB columns in the grouping expression.

This is a Teradata extension to the ANSI SQL:2011 standard.

column_expression List of valid SQL expressions specified for the GROUP BY clause.

You can specify column_name, column_position, and expression either as single entries or as a list.

You can specify a scalar subquery as an ordinary grouping set expression.

You can also specify a scalar UDF as an ordinary grouping set expression.

You cannot include LOB columns in the ordinary grouping set.

Use of column_expression is a Teradata extension to the ANSI SQL:2011 standard.