Release 10.1A: OpenEdge Data Management:
SQL Reference

> ## COUNT

> Computes either the number of rows in a group of rows or the number of non-`NULL` values in a group of values.

> #### Syntax

>     COUNT ( { [ ALL ] expression } | { DISTINCT column_ref } | * )

> Example

> This example illustrates the `COUNT` function:

>     SELECT COUNT (*)
>          FROM orders
>          WHERE order_date = SYSDATE ;

> #### Notes

> - The keyword `DISTINCT` specifies that the duplicate values are to be eliminated before computing the count.

> - If the argument to `COUNT` function is ‘*’, then the function computes the count of the number of rows in a group.

> - If the argument to `COUNT` function is not ‘*’, then `NULL` values are eliminated before the number of rows is computed.

> - The argument `column_ref` or `expression` can be of any type.

> - The result of the function is of integer type. The result is never `NULL`.

Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095