sql - Finding total number of rows of tables across multiple databases -
i have 67 different databases , each database has more 1 common table. 1 such table company , want find total rows in table databases. how can write query total number of rows databases?
you can query information schema.
select sum(table_rows) information_schema.tables table_name = 'company' you can use engine column in table see if you're counting on myisam tables (the table_rows correct then), or innodb (table_rows estimate used optimizer)
if have more company table, can group tablename :)
Comments
Post a Comment