ASA SQL Reference
SQL Functions
Alphabetical list of functions
Counts the number of rows in a group depending on the specified parameters.
COUNT (
*
| expression
| DISTINCT { expression | column-name } )
* Returns the number of rows in each group.
expression Returns the number of rows in each group where the expression is not the null value.
DISTINCT expression or column-name Returns the number of different values in the expression, or the column with name column-name. Rows where the value is the NULL value are not included in the count.
SQL/92 SQL/92 compatible.
SQL/99 Vendor extension.
Sybase Compatible with Adaptive Server Enterprise.
The following statement returns each unique city, and the number of rows with that city value:
SELECT city , Count(*) FROM employee GROUP BY city