COUNT
All functions > AGGREGATE > COUNT
Returns the number of values in the group.
Syntax
COUNT(expr, group_by, where)
sql
Arguments
Parameter | Type | Required | Description |
---|---|---|---|
expr | BIGINT | Yes | The expression to count |
Returns
The number of non-NULL values in the group
Notes
- Counts non-NULL values in the group
- NULL values are excluded from the count
- Returns 0 for empty groups
- Can be used with WHERE clause to filter before counting
- Can be used with GROUP BY clause for grouped counts
- Use COUNT(*) to count all rows including NULLs