MySQL - 如何在一个查询中计算每个表的所有行

2021-12-30 00:00:00 sql count mysql

有没有办法查询数据库以找出所有表中有多少行?

Is there a way to query the DB to find out how many rows there are in all the tables?

table1 1234
table2 222
table3 7888

希望大家多多指教

推荐答案

SELECT 
    TABLE_NAME, 
    TABLE_ROWS 
FROM 
    `information_schema`.`tables` 
WHERE 
    `table_schema` = 'YOUR_DB_NAME';

相关文章