select count(1) from information_schema.columns where table_schema = "testdatabase" and table_name ='testtable'
//查看某个数据库中某个表有多少字段
select count(1) from information_schema.columns where table_schema = "testdatabase"
//查看某个数据库中整体有多少字段
select count(1) , table_schema from information_schema.tables where table_schema ='testdatabase'
//查看某个数据库中有多少表
select count(1) , table_schema from information_schema.tables group by table_schema
//查看所有的数据库中各有多少表
今天这个需求就被我碰到了,也不知道干嘛用,领导让统计,留下来统计方法把,给需要的猿们