将mysql某个数据库中表的行数从大到小排序
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了将mysql某个数据库中表的行数从大到小排序,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含1932字,纯文字阅读大概需要3分钟。
内容图文
![将mysql某个数据库中表的行数从大到小排序](/upload/InfoBanner/zyjiaocheng/491/f2a17c3b9877415fb38bcf0c195b0aec.jpg)
随着公司的业务越来越大,工作中需要对某一个数据库的表进行分表,为了做的更细致一点,在该数据库中,将所有表,按行数从到小排序:
实现方式:
mysql> use information_schema;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
mysql> select table_name,table_rows from tables order by table_rows desc limit 30;
+----------------------+------------+
| table_name | table_rows |
+----------------------+------------+
| log | 144359031 |
| base_log | 49708134 |
| base_log_201708 | 15838445 |
| log_201706 | 11768358 |
| customer_log | 9625275 |
| log_201708 | 7856959 |
| base_log_201707 | 6270253 |
| debug_log | 5708789 |
| allocate_log | 5612445 |
| web_api_log | 5078173 |
| log_201707 | 4353787 |
| communication_log | 3069630 |
| base_log_201706 | 2751581 |
| log_201709 | 2028525 |
| sms_log | 1074787 |
| service_log | 977777 |
| fjs_behavior_log | 819606 |
| ocdc_customer | 811990 |
| base_log_201709 | 733253 |
| 5kcrm_fenpei_log | 524252 |
| customer_sale | 517155 |
| sys_crmdata_log | 500943 |
| 5kcrm_log | 471193 |
| phone_log | 470699 |
| 5kcrm_r_customer_log | 453022 |
| realestate_needs | 434770 |
| service_customer_log | 428040 |
| mail | 342659 |
| users | 331449 |
| phone_areas | 328089 |
+----------------------+------------+
30 rows in set (0.97 sec)
本文出自 “莲池管俊涛的51cto博客” 博客,谢绝转载!
将mysql某个数据库中表的行数从大到小排序
标签:mysql 表的行数 排序
本文系统来源:http://9285090.blog.51cto.com/9275090/1963714
内容总结
以上是互联网集市为您收集整理的将mysql某个数据库中表的行数从大到小排序全部内容,希望文章能够帮你解决将mysql某个数据库中表的行数从大到小排序所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。