15.10 - COUNT(value_expression) - Teradata Database

Teradata Database SQL Data Definition Language Syntax and Examples

Teradata Database
Release Number
December 2015
Content Type
Programming Reference
Publication ID
English (United States)

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 SQL Functions, Operators, Expressions, and Predicates, B035-1145.