COUNT_BIG

Returns the number of items in a group. COUNT_BIG works like the COUNT function. The only difference between the two functions is their return values. COUNT_BIG always returns a bigint data type value. COUNT always returns an int data type value.

Syntax

COUNT_BIG ( { [ ALL | DISTINCT ] expression } | * ) 
   [ OVER ( [ partition_by_clause ] [ order_by_clause ] ) ]

Arguments

expression

Is an expression of any type. Aggregate functions and subqueries are not permitted.

Return types

bigint

Example

SELECT COUNT_BIG(DISTINCT [IdNullable]) AS [CountBigDist] FROM [BasicDataTable]

See Also