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

SQL Date and Time Functions and Expressions

Product
Advanced SQL Engine
Teradata Database
Release Number
17.05
17.00
Published
June 2020
Language
English (United States)
Last Update
2021-01-24
dita:mapPath
xmd1556127764262.ditamap
dita:ditavalPath
lze1555437562152.ditaval
dita:id
B035-1211
lifecycle
previous
Product Category
Teradata Vantage™

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.