count()

Aggregate. Returns the number of rows in a group, excluding NULL values.

Syntax

count ( * | expression )

Parameters

expression

A column from the source or an expression typically based upon columns from the source. It can also be a constant expression.

Usage

This function counts all sets of non-NULL rows and returns a long. The function returns the number of rows in a group, excluding NULL values. Use the * syntax to return the number of rows in the group, or use the expression argument to return the number of non-NULL rows.