1. 程式人生 > >mysql統計庫下所有表資料行數

mysql統計庫下所有表資料行數

一、執行下面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”: