Return the total number of rows in a table.
Section: aggregation and grouping
Count all rows
sql
sql
SELECT COUNT(*) AS total_users FROM users;Explanation
A basic but essential query for dashboards and sanity checks.
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