Syntax Elements - Teradata Database

SQL Data Manipulation Language

Product
Teradata Database
Release Number
15.10
Language
English (United States)
Last Update
2018-10-06
dita:id
B035-1146
lifecycle
previous
Product Category
Teradata® Database
 

Syntax Element …

Specifies …

GROUP BY

a reference to one or more expressions in the select expression list.

ordinary_grouping_set

a column expression by which the rows returned by the statement are grouped.

You cannot specify BLOB, CLOB, Period, ARRAY, VARRAY, XML, or JSON columns in the grouping expression.

ordinary_grouping_set falls into three general categories.

  • column_name
  • column_position
  • column_expression
  • See “Ordinary Grouping Set Expressions” on page 128 for the definitions of these expressions.

    empty_grouping
    _set

    a contiguous LEFT PARENTHESIS, RIGHT PARENTHESIS pair without an argument. This syntax is used to request a grand total.

    The term grand total here refers to a summation of all the individual group totals, not a summation of the nonaggregate data.

    rollup_list

    a ROLLUP expression that reports result rows in a single dimension with one or more levels of detail. See “ROLLUP Grouping Set Option” on page 142 for more information.

    The expression cannot group result rows that have a BLOB, CLOB, ARRAY, or VARRAY type.

    cube_list

    a CUBE expression that reports result rows in multiple dimensions with one or more levels of detail. See “CUBE Grouping Set Option” on page 136 for more information.

    The expression cannot group result rows that have a BLOB, CLOB, ARRAY, or VARRAY type.

    grouping_sets_
    specification

    a GROUPING SETS expression that reports result rows in one of two ways:

  • As a single dimension, but without a full ROLLUP.
  • As multiple dimensions, but without a full CUBE.
  • See “GROUPING SETS Option” on page 139 for more information.