SQLite COUNT() Function
Definition and Usage
The COUNT() function returns the number of rows. COUNT(*) counts all the rows, and COUNT(column) counts the rows where the column is not NULL.
Syntax
COUNT(expression)
COUNT(*)
Parameter Values
| Parameter | Description |
|---|---|
| expression | Required. A column, or * for all the rows. Add DISTINCT to count only the different values |
Technical Details
| Return type: | Integer |
|---|
More Examples
Example
Count the different countries of the customers:
SELECT COUNT(DISTINCT Country)
FROM Customers;
Try it Yourself »