mysqlでテーブルのレコード数を取得する方法です。 select count(*) from テーブル名 でもよいのですが、たとえばDBの全テーブルのレコード数を知りたい場合には、テーブル数だけ select を実行しなければならなくなります。 こんな場合には、mysqlのテーブル情報でも書いた information_schema DB の TABLES テーブルから情報を取得します。 > select table_name, table_rows from information_schema.TABLES; +------------+------------+ | table_name | table_rows | +------------+------------+ | tbl1 | 10 | | tbl2 | 5 | | tbl3 | 5 | +------------+-
![mysqlでテーブルのレコード数を確認する方法 - dak ブログ](https://cdn-ak-scissors.b.st-hatena.com/image/square/df3a50c14b465108d37d0f484920317dd74971fb/height=288;version=1;width=512/http%3A%2F%2Fu.xgoo.jp%2Fimg%2Fsns%2Fblog.png)