首页 > 数据库技术 > 详细

mysql quick query row count using sql

时间:2019-06-16 10:16:08      阅读:137      评论:0      收藏:0      [点我收藏+]

1. command

show table status like {table-name};

 

2. sample

mysql> use inventory;
Database changed
mysql> show tables;
+---------------------+
| Tables_in_inventory |
+---------------------+
| customers           |
| decimalTest         |
| orders              |
| orders1             |
| products            |
| products_on_hand    |
| t_amount_cumulation |
| t_member_inf        |
| test                |
| test2               |
+---------------------+
10 rows in set (0.00 sec)

mysql> show table status like ‘customers‘;
+-----------+--------+---------+------------+------+----------------+-------------+-----------------+--------------+-----------+----------------+---------------------+-------------+------------+-----------------+----------+----------------+---------+
| Name      | Engine | Version | Row_format | Rows | Avg_row_length | Data_length | Max_data_length | Index_length | Data_free | Auto_increment | Create_time         | Update_time | Check_time | Collation       | Checksum | Create_options | Comment |
+-----------+--------+---------+------------+------+----------------+-------------+-----------------+--------------+-----------+----------------+---------------------+-------------+------------+-----------------+----------+----------------+---------+
| customers | InnoDB |      10 | Dynamic    |    4 |           4096 |       16384 |               0 |        16384 |         0 |           1006 | 2019-06-13 02:15:15 | NULL        | NULL       | utf8_unicode_ci |     NULL |                |         |
+-----------+--------+---------+------------+------+----------------+-------------+-----------------+--------------+-----------+----------------+---------------------+-------------+------------+-----------------+----------+----------------+---------+
1 row in set (0.00 sec)

 The output result indicate the row number of the table: customers is 4.

技术分享图片

 

mysql quick query row count using sql

原文:https://www.cnblogs.com/lenmom/p/11029413.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!