MYSQL指定数据库查询所有表行数_MySQL
程序员文章站
2022-05-13 18:15:55
...
bitsCN.com
MYSQL指定数据库查询所有表行数
[sql] SELECT CONCAT('union all select ''', TABLE_SCHEMA ,''' as db ,''',TABLE_NAME,''' as tbname, count(1) as rows from ', TABLE_SCHEMA ,'.',TABLE_NAME ) AS SqlExe FROM information_schema.TABLES AS t WHERE t.TABLE_TYPE = 'BASE TABLE' AND t.TABLE_SCHEMA = 'AdDataCenter'
-- 因为直接访问视图时,mysql数据统计不精确。
bitsCN.com
推荐阅读