16.20 - COUNT(value_expression) - Teradata Database - Teradata Vantage NewSQL Engine

Teradata Vantage™ SQL Data Definition Language Syntax and Examples

Product
Teradata Database
Teradata Vantage NewSQL Engine
Release Number
16.20
Published
March 2019
Content Type
Programming Reference
Publication ID
B035-1144-162K
Language
English (United States)
Last Update
2019-05-24

Use the COUNT aggregate function to count the number of values in the column or column expression with any data type, specified by value_expression.

You cannot specify a COUNT function in the definition of a column-partitioned join index.

For a column defined by the COUNT function, you can specify the data type as FLOAT, DECIMAL (38,0), NUMBER, or BIGINT. If you do not assign a data type to a COUNT column, the data type defaults to FLOAT.

COUNT DISTINCT is not permitted.

Each aggregate join index must be created with a COUNT(*) or a COUNT(value_expression).

If you do not specify this expression, the system adds a COUNT(*) to the definition for index maintenance, with the default name of CountStar. Do not use the name CountStar if you create an aggregate join index because Teradata Database reserves that name for any expression being summed or counted in the index definition.

For more information about the COUNT aggregate function, see Teradata Vantage™ SQL Functions, Expressions, and Predicates, B035-1145.