GROUPING Function | Teradata Vantage - 17.10 - GROUPING - Advanced SQL Engine - Teradata Database

Teradata Vantage™ - SQL Functions, Expressions, and Predicates

Product
Advanced SQL Engine
Teradata Database
Release Number
17.10
Release Date
July 2021
Content Type
Programming Reference
Publication ID
B035-1145-171K
Language
English (United States)

Returns a value that indicates whether a specified column in the result row was excluded from the grouping set of a GROUP BY clause.

IF the value of the specified column in the result row is … THEN GROUPING returns …
a NULL generated when the extended grouping specification aggregated over the column and excluded it from the particular grouping 1
anything else 0