Count table rows

后端 未结 11 2038
一个人的身影
一个人的身影 2020-11-28 21:55

What is the MySQL command to retrieve the count of records in a table?

11条回答
  •  被撕碎了的回忆
    2020-11-28 22:50

    We have another way to find out the number of rows in a table without running a select query on that table.

    Every MySQL instance has information_schema database. If you run the following query, it will give complete details about the table including the approximate number of rows in that table.

    select * from information_schema.TABLES where table_name = 'table_name'\G
    

提交回复
热议问题