Hitachi

Hitachi Advanced Database SQL Reference


7.22.1 COUNT(*)

COUNT(*) determines the number of input rows to the set function.

Organization of this subsection

(1) Specification format

set-function-COUNT(*) ::= COUNT(*)

(2) Rules

  1. The data type of the execution result is INTEGER.

  2. If the number of input rows is 0, the result will be 0.

(3) Example

Example

Using the data in the employee table (EMPLIST), this example determines the number of male employees in section S001.

SELECT COUNT(*) AS "COUNT"
    FROM "EMPLIST"
        WHERE "SCODE"='S001' AND "SEX"='M'

Example of execution results

[Figure]