Home > Database > Mysql Tutorial > body text

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

Mary-Kate Olsen
Release: 2024-11-06 04:11:02
Original
447 people have browsed it

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;
Copy after login

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!

source:php.cn
Statement of this Website
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
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template