|
<< Click to Display Table of Contents >> COUNT function |
![]() ![]()
|
Returns the number of rows that satisfy a query’s search condition.
COUNT(* | [ALL] column_reference | DISTINCT column_reference)
Use COUNT to count the number of rows retrieved by a SELECT statement. The SELECT statement may be a single- or multi-table query.
SELECT COUNT(Amount)
FROM Averaging
ALL returns the count for all rows. When DISTINCT is not specified, ALL is the implied default.
DISTINCT ignores duplicate values in the specified column when counting rows.
If the dataset is filtered using a WHERE clause, the COUNT function reflects the number of rows in the filtered version of the dataset, not the unfiltered version.
SELECT COUNT(*)
FROM "Clients.dbf"
WHERE State = "CA"