COUNT

COUNT (* | [DISTINCT] expression)

Description

The count of all entries or of the non-null values. This method returns a long. If no entries are selected, the result is 0. Aggregates are only allowed in select statements.

Example

Calculate a players' number in every city:

SELECT city_id, COUNT(*) FROM Players GROUP BY city_id;