Section: Aggregation and Grouping

Count rows

sql
sql
SELECT COUNT(*) AS row_count
FROM users;
Explanation

COUNT(*) includes rows regardless of NULL values.

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing Aggregation and Grouping
Group by a column
Aggregate values per group.
OpenIn sheetsqlsame section
Group by multiple columns
Aggregate by more than one dimension.
OpenIn sheetsqlsame section
Filter groups with HAVING
Apply conditions after aggregation.
OpenIn sheetsqlsame section
Use common aggregate functions
Calculate summary metrics.
OpenIn sheetsqlsame section
Select all columns
Return all columns from a table.
Filter with equality
Return rows matching an exact value.