Aggregate Functions and ANSI DateTime and Interval Data Types | Teradata Vantage - 17.00 - 17.05 - Aggregate Functions and ANSI DateTime and Interval Data Types - Advanced SQL Engine - Teradata Database

Teradata Vantage™ - SQL Date and Time Functions and Expressions

Product
Advanced SQL Engine
Teradata Database
Release Number
17.00
17.05
Release Date
June 2020
Content Type
Programming Reference
Publication ID
B035-1211-170K
Language
English (United States)

The following aggregate functions are valid for ANSI SQL:2011 DateTime types.

For this function … The result is …
AVG(arg) the type of the argument.
MAX(arg) the type of the argument, based on the comparison rules for DateTime types.
MIN(arg)
COUNT(arg) INTEGER, if the mode is Teradata.
DECIMAL(n,0), if the mode is ANSI, where:
  • n is 15 if MaxDecimal in DBSControl is 0, 15, or 18.
  • n is 38 if MaxDecimal in DBSControl is 38.

For more information about these functions, see Teradata Vantage™ - SQL Functions, Expressions, and Predicates, B035-1145.