Skip to content

Instantly share code, notes, and snippets.

@wernersmit
Created July 17, 2014 11:03
Show Gist options
  • Save wernersmit/957c5bae8b07b159d39d to your computer and use it in GitHub Desktop.
Save wernersmit/957c5bae8b07b159d39d to your computer and use it in GitHub Desktop.
Get total row count by table name for all tables in a db.
SELECT SUM(TABLE_ROWS), TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = '{DB_NAME}' GROUP BY TABLE_NAME;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment