tags:

views:

243

answers:

2

Is there a MySQL command to get a count on the # of rows in a table, & if so, what is it?

+10  A: 

MySQL COUNT() function

SELECT COUNT(*) FROM table
Eran Galperin
A: 

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
Dustin