information_schema是Mysql默认的一个数据库,用于记录数据库(SCHEMATA)、数据的表(TABLES)、表的列(COLUMNS)等信息
SELECT * from SCHEMATA;
SELECT * from `TABLES`;
SELECT * from `COLUMNS`;
查询一个数据的所有记录总数
SELECT table_name,table_rows FROM information_schema.TABLES WHERE TABLE_SCHEMA = 'crm' ORDER BY table_rows DESC;
SELECT SUM(table_rows) FROM information_schema.TABLES WHERE TABLE_SCHEMA = 'crm' ORDER BY table_rows DESC;