Home  >  Article  >  Database  >  How to Count the Number of Records in a MySQL Table?

How to Count the Number of Records in a MySQL Table?

Mary-Kate Olsen
Mary-Kate OlsenOriginal
2024-11-06 04:11:02469browse

How to Count the Number of Records in a MySQL Table?

Determining Record Count in MySQL Tables

Question: How does one obtain the count of records present within a MySQL table?

Answer:

To retrieve the count of records in a MySQL table, the following command can be employed:

SELECT COUNT(*) FROM fooTable;

Utilizing this query will return the total number of rows present within the "fooTable" table. It is important to note that the "COUNT(*)" expression counts all non-NULL values in the table, irrespective of column or data type.

For further reference, consult the official reference manual.

The above is the detailed content of How to Count the Number of Records in a MySQL Table?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn