COUNT

Some parts in the output code are omitted for clarity reasons.

Description

This function returns the number of items found in a group. COUNT operates like the COUNT_BIG function. These functions differ only in the data types of their return values. COUNT always returns an int data type value. COUNT_BIG always returns a bigint data type value. (COUNT in Transact-SQL).

Sample Source Pattern

Syntax

COUNT ( { [ [ ALL | DISTINCT ] expression ] | * } )  

Examples

Code:

IN -> SqlServer_01.sql
SELECT COUNT(NATIONALIDNUMBER) FROM HUMANRESOURCES.EMPLOYEE AS TOTAL;

Result:

TOTAL|
-----+
  290|

Last updated