Home > Database > Mysql Tutorial > How do I count the number of rows in a MySQL table?

How do I count the number of rows in a MySQL table?

Mary-Kate Olsen
Release: 2024-11-04 22:25:02
Original
540 people have browsed it

How do I count the number of rows in a MySQL table?

Counting Table Rows in MySQL

In MySQL, you can easily retrieve the count of records in a table using the SQL command:

SELECT COUNT(*) FROM table_name;

For example, to count the number of rows in the Customers table, you would use the following query:

SELECT COUNT(*) FROM Customers;
Copy after login

The above is the detailed content of How do I count the number of rows 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