Nested Aggregation | Teradata Vantage - 17.00 - Nested Aggregation - Teradata Database

Teradata Vantageā„¢ - Time Series Tables and Operations

prodname
Advanced SQL Engine
Teradata Database
vrm_release
17.00
created_date
June 2020
category
Programming Reference
featnum
B035-1208-170K

Direct nesting of aggregates is not supported in Vantage, such as SELECT AVG(AVG(column))...). However, nested aggregates can be evaluated using a derived table that contains the aggregates to be nested. This is supported by both the GROUP BY TIME clause and the GROUP BY clause. The following examples show this for the GROUP BY TIME clause.