一、執行下面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刪除。