- 积分
- 6147
- UID
- 2
- 阅读权限
- 200
- 注册时间
- 2007-3-19
- 精华
- 在线时间
- 小时
- 最后登录
- 1970-1-1
- 职业
- 1
|
适用于MySQL5.0以上版本。
1、构造SQL语句
sql>use information_schema;
sql>select concat("select """, TABLE_name,""", count(*) from ", TABLE_name," union all") from tables where TABLE_SCHEMA='huashan';
2、执行后输出:
select "BackUpinfo", count(*) from BackUpinfo union all
select "CustomQuery", count(*) from CustomQuery union all
select "DATA_SOURCE", count(*) from DATA_SOURCE union all
select "DBTableList", count(*) from DBTableList union all
select "DBTableType", count(*) from DBTableType union all
select "DEVICE", count(*) from DEVICE union all
......
3、结果:
...... |
|