COUNT

Returns the number of rows or values in a set of rows or values. The argument of COUNT(*) is a set of rows. The result is the number of rows in the set. The argument of COUNT (expression) is a set of values. The result is the number of values in the set. The argument of COUNT (DISTINCT expression) is a set of values. The argument values can be any values except character strings with a length attribute greater than 2000, graphic strings with a length attribute greater than 1000 DBCS or UCS-2 characters, LOBs, or DataLinks.

Example:

Using the EMPLOYEE table, return the number of rows where the value of the SEX column is 'F'.

   SELECT COUNT(*)
      FROM EMPLOYEE
     WHERE SEX = 'F'

Returns 13 when using the sample table.