COUNT(value_expression) - Advanced SQL Engine - Teradata Database

SQL Data Definition Language Syntax and Examples

Product
Advanced SQL Engine
Teradata Database
Release Number
17.05
Published
January 2021
Language
English (United States)
Last Update
2021-01-22
dita:mapPath
ncd1596241368722.ditamap
dita:ditavalPath
hoy1596145193032.ditaval
dita:id
B035-1144
lifecycle
previous
Product Category
Teradata Vantage™

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 Vantage 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.