Is there a MySQL command to get a count on the number of rows in a table, and if so, what is it?
MySQL COUNT() function
SELECT COUNT(*) FROM table
A nice way to get AN ESTIMATE of the number of rows can be via meta-data information in the information_schema tables.
Note, this is just an ESTIMATE used for query optimizations.
There may be a way to get exact # of rows from the information_schema, but I am not 100% sure if this is possible.
SELECT table_schema, table_name, table_rows FROM information_schema.tables ORDER BY table_rows DESC
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With