Count table rows

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

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

11条回答
  •  [愿得一人]
    2020-11-28 22:57

    If you have several fields in your table and your table is huge, it's better DO NOT USE * because of it load all fields to memory and using the following will have better performance

    SELECT COUNT(1) FROM fooTable;
    

提交回复
热议问题