SQL$HELP_OLD72.HLB  —  Aggregate Functions, COUNT Function
    There are three forms of the COUNT function:

    o  COUNT (*)  calculates the number of rows in a result table.
       It is the only function that does not allow a specific column
       name in its argument. The data type of the resulting value
       expression is an integer.

    o  COUNT (value-expr) calculates the number of non-NULL values of
       the value-expr in a result table. The value-expr is evaluated
       for each row and, if non-NULL, the count is incremented or the
       value is counted. The data type of the resulting value is an
       integer.

    o  COUNT (DISTINCT value-expr) calculates the number of distinct
       values of the specified value-expr in the result table. The
       COUNT DISTINCT function eliminates duplicate values from the
       number it calculates. The value-expr is evaluated for each row
       and, if non-NULL and if different from previously seen values,
       the value is counted. It does not count null values in the
       specified value-expr. The data type of the resulting value is
       an integer.

    If there are no values in the result table to which the COUNT
    function is applied, the COUNT function returns a zero.
Close Help