15.00 - Aggregate Functions and ANSI DateTime and Interval Data Types - Teradata Database

Teradata Database SQL Functions, Operators, Expressions, and Predicates

Product
Teradata Database
Release Number
15.00
Content Type
Programming Reference
Publication ID
B035-1145-015K
Language
English (United States)

Aggregate Functions and ANSI DateTime and Interval Data Types

DateTime Data Types

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

 

For this function …

The result is …

For more information, see …

AVG(arg)

the type of the argument.

“AVG” on page 34.

MAX(arg)

the type of the argument, based on the comparison rules for DateTime types.

“MAX” on page 55.

MIN(arg)

“MIN” on page 58.

COUNT(arg)

INTEGER, if the mode is Teradata.

“COUNT” on page 40.

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.
  • Interval Data Types

    The following aggregate functions are valid for Interval types.

     

    For this function …

    The result is …

    For more information, see …

    AVG(arg)

    the type of the argument.

    “AVG” on page 34.

    COUNT(arg)

    INTEGER, if the mode is Teradata.

    “COUNT” on page 40.

    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.
  • MAX(arg)

    the type of the argument, based on the comparison rules for DateTime types.

    “MAX” on page 55.

    MIN(arg)

    “MIN” on page 58.

    SUM(arg)

    the type of the argument.

    “SUM” on page 100.