一、执行下面sql
select concat(
'select "',
TABLE_name,
'", count(*) from ',
TABLE_SCHEMA,
'.',
TABLE_name,
' union all'
) from information_schema.tables
where TABLE_SCHEMA='test';
二、执行上面sql后会批量生成sql
三、把生成的sql拷出来,并去掉最后的一个“union all”:
一、执行下面sql
select concat(
'select "',
TABLE_name,
'", count(*) from ',
TABLE_SCHEMA,
'.',
TABLE_name,
' union all'
) from information_schema.tables
where TABLE_SCHEMA='test';
二、执行上面sql后会批量生成sql
三、把生成的sql拷出来,并去掉最后的一个“union all”:
本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。