Home > Database > Mysql Tutorial > MYSQL指定数据库查询所有表行数_MySQL

MYSQL指定数据库查询所有表行数_MySQL

WBOY
Release: 2016-06-01 13:28:53
Original
1188 people have browsed it

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'  
Copy after login

 

 

-- 因为直接访问视图时,mysql数据统计不精确。

 

bitsCN.com
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template