• mysql quick query row count using sql


    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.

  • 相关阅读:
    企业要主动淘汰五种人
    人力管理的核心:选、用、育、留
    张瑞敏:正确路线确定后,干部就是决定因素
    西点军校如何培养学员
    董事长如何找合适的搭档
    企业家何时应该放权
    会计基础视频
    同样劳动,为何结果不同?
    什么是真正的工作到位
    中国的人口和经济周期
  • 原文地址:https://www.cnblogs.com/lenmom/p/11029413.html
Copyright © 2020-2023  润新知