count

This function is used to return the number of records.

Syntax

count([distinct|all] <colname>)

Parameters

Table 1 Parameters

Parameter

Mandatory

Description

distinct or all

No

Determines whether duplicate records should be excluded during counting. all is used by default, indicating that all records will be included in the count.

If distinct is specified, only the number of unique values is counted.

colname

Yes

The column value can be of any type.

The value can be *, that is, count(*), indicating that the number of all rows is returned.

Return Values

The return value is of the BIGINT type.

If the value of colname is NULL, the row is not involved in calculation.

Example Code