Created
May 10, 2019 13:43
-
-
Save olivertappin/c56327a944200f77ae44741f026d809d to your computer and use it in GitHub Desktop.
Show counts of all table rows from a particular database using information_schema
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT | |
TABLE_NAME AS DATABASE_NAME, | |
FORMAT(TABLE_ROWS, 0) AS Rows | |
FROM information_schema.tables | |
WHERE | |
table_schema = 'DATABASE_NAME' | |
AND TABLE_ROWS > 0 | |
; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment