Skip to content

Instantly share code, notes, and snippets.

@troynt
Created July 8, 2013 20:36
Show Gist options
  • Save troynt/5952276 to your computer and use it in GitHub Desktop.
Save troynt/5952276 to your computer and use it in GitHub Desktop.
Get Row Counts in MySQL
SELECT
TABLE_SCHEMA, TABLE_NAME, SUM(TABLE_ROWS) as row_count
FROM
INFORMATION_SCHEMA.TABLES
GROUP BY TABLE_SCHEMA , TABLE_NAME
HAVING row_count > 0
ORDER BY row_count desc;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment