Previous Topic: AVG FunctionNext Topic: MAX Function


COUNT Function

The COUNT function returns the number of rows in a specified table. In the simplest example, you could count all of the rows in the APPLICATIONS table with this statement:

OPSQL SELECT COUNT (*) FROM WORKSTATIONS

You can also use the WHERE clause in conjunction with COUNT to narrow the scope of your tally. For example, to count the number of applications in the APPLICATIONS table that user TSOUSR1 altered, you would use this statement:

OPSQL SELECT COUNT (*) FROM WORKSTATIONS WHERE COST < 3000