当前位置: 首页 > news >正文

统计Mysql库中每个表的总行数,解决table_rows不准确问题

1、拼接SQL

selectsubstring( GROUP_CONCAT(a.sf SEPARATOR ''),1,length(GROUP_CONCAT(a.sf SEPARATOR ''))-10) as sql_str
from( select concat('select "', TABLE_name , '", count(*) as row_num from ', TABLE_SCHEMA, '.',TABLE_name,' union all '
) as sf
frominformation_schema.tables
whereTABLE_SCHEMA = 'szwx') a

注意:GROUP_CONCAT()默认容量是1024,拼接sql会出现截断,设置的大一些。

执行:SET SESSION group_concat_max_len = 102400;

2.输出SQL

select "city_government_service", count(*) as row_num from szwx.city_government_service union all select "city_production_pack", count(*) as row_num from szwx.city_production_pack union all select "city_service_pack", count(*) as row_num from szwx.city_service_pack union all select "city_traffic_pack", count(*) as row_num from szwx.city_traffic_pack union all select "czj_dwd_wx_expenditure_report", count(*) as row_num from szwx.czj_dwd_wx_expenditure_report union all select "czj_dwd_wx_financeincome", count(*) as row_num from szwx.czj_dwd_wx_financeincome union all select "czj_dwd_wx_income_report", count(*) as row_num from szwx.czj_dwd_wx_income_report union all select "czj_dwd_wx_tax_revenue", count(*) as row_num from szwx.czj_dwd_wx_tax_revenue union all select "dwd_wx_geography_tab", count(*) as row_num from szwx.dwd_wx_geography_tab union all select "dwd_wx_tourist_route", count(*) as row_num from szwx.dwd_wx_tourist_route union all select "dwd_wx_tourist_spots", count(*) as row_num from szwx.dwd_wx_tourist_spots union all select "fgj_great_item_table", count(*) as row_num from szwx.fgj_great_item_table union all select "jyj_dwd_teacher_education", count(*) as row_num from szwx.jyj_dwd_teacher_education union all select "jyj_dwd_wx_expected_retire_data", count(*) as row_num from szwx.jyj_dwd_wx_expected_retire_data union all select "jyj_dwd_wx_school_counts", count(*) as row_num from szwx.jyj_dwd_wx_school_counts union all select "jyj_dwd_wx_student_data", count(*) as row_num from szwx.jyj_dwd_wx_student_data union all select "jyj_dwd_wx_teacher_data", count(*) as row_num from szwx.jyj_dwd_wx_teacher_data union all select "lyj_dwd_wx_forestry", count(*) as row_num from szwx.lyj_dwd_wx_forestry union all select "lyj_june2023_scenicareareception", count(*) as row_num from szwx.lyj_june2023_scenicareareception union all select "mzj_cx_ep_support_statistics", count(*) as row_num from szwx.mzj_cx_ep_support_statistics union all select "mzj_dis_disabled_statistics", count(*) as row_num from szwx.mzj_dis_disabled_statistics union all select "mzj_dwd_wx_county_civil_affairs_objects_and_standard", count(*) as row_num from szwx.mzj_dwd_wx_county_civil_affairs_objects_and_standard union all select "mzj_dwd_wx_county_orphan_statistic", count(*) as row_num from szwx.mzj_dwd_wx_county_orphan_statistic union all select "mzj_dwd_wx_county_social_welfare", count(*) as row_num from szwx.mzj_dwd_wx_county_social_welfare union all select "mzj_dwd_wx_minimum_living_security_objects", count(*) as row_num from szwx.mzj_dwd_wx_minimum_living_security_objects union all select "nyncj_dwd_wx_cold_storage_subsidy_info", count(*) as row_num from szwx.nyncj_dwd_wx_cold_storage_subsidy_info union all select "py_cloud_img", count(*) as row_num from szwx.py_cloud_img union all select "qyrkxxgl_contraception_statistics", count(*) as row_num from szwx.qyrkxxgl_contraception_statistics union all select "qyrkxxgl_fecund_women_conditions", count(*) as row_num from szwx.qyrkxxgl_fecund_women_conditions union all select "qyrkxxgl_population_basic_info", count(*) as row_num from szwx.qyrkxxgl_population_basic_info union all select "qyrkxxgl_population_natural_change", count(*) as row_num from szwx.qyrkxxgl_population_natural_change union all select "scjdglj_basic_library_establishment_query", count(*) as row_num from szwx.scjdglj_basic_library_establishment_query union all select "scjdglj_task_progress_query", count(*) as row_num from szwx.scjdglj_task_progress_query union all select "shp_dwd_wx_jg", count(*) as row_num from szwx.shp_dwd_wx_jg union all select "tjj_domestic_trade", count(*) as row_num from szwx.tjj_domestic_trade union all select "tjj_dwd_wx_2023_grain_production", count(*) as row_num from szwx.tjj_dwd_wx_2023_grain_production union all select "tjj_dwd_wx_agri_forest_total_output", count(*) as row_num from szwx.tjj_dwd_wx_agri_forest_total_output union all select "tjj_dwd_wx_animal_veggie_prod", count(*) as row_num from szwx.tjj_dwd_wx_animal_veggie_prod union all select "tjj_dwd_wx_industrial_value_added_growth", count(*) as row_num from szwx.tjj_dwd_wx_industrial_value_added_growth union all select "tjj_dwd_wx_major_target_performance", count(*) as row_num from szwx.tjj_dwd_wx_major_target_performance union all select "tjj_dwd_wx_monthly_economic_indicators_monitor", count(*) as row_num from szwx.tjj_dwd_wx_monthly_economic_indicators_monitor union all select "tjj_dwd_wx_national_economic_accounting", count(*) as row_num from szwx.tjj_dwd_wx_national_economic_accounting union all select "tjj_fixed_asset_investment", count(*) as row_num from szwx.tjj_fixed_asset_investment union all select "tjj_industrial_economic_benefit", count(*) as row_num from szwx.tjj_industrial_economic_benefit union all select "tjj_industrial_output", count(*) as row_num from szwx.tjj_industrial_output union all select "tjj_industrial_sales", count(*) as row_num from szwx.tjj_industrial_sales union all select "tjj_real_estate_dev_status", count(*) as row_num from szwx.tjj_real_estate_dev_status union all select "wtj_dwd_wx_health_service_statistics", count(*) as row_num from szwx.wtj_dwd_wx_health_service_statistics union all select "wtj_public_health_data_65yearold_management_statistics", count(*) as row_num from szwx.wtj_public_health_data_65yearold_management_statistics union all select "wtj_public_health_data_diabetes_health_service_statistics", count(*) as row_num from szwx.wtj_public_health_data_diabetes_health_service_statistics union all select "wtj_public_health_data_health_education_service_statistics", count(*) as row_num from szwx.wtj_public_health_data_health_education_service_statistics union all select "wtj_public_health_data_hyperglycemia_health_service_statistics", count(*) as row_num from szwx.wtj_public_health_data_hyperglycemia_health_service_statistics union all select "wtj_public_health_data_hypertension_service_statistics", count(*) as row_num from szwx.wtj_public_health_data_hypertension_service_statistics union all select "wtj_public_health_data_mental_disorder_health_service_statistics", count(*) as row_num from szwx.wtj_public_health_data_mental_disorder_health_service_statistics union all select "wtj_public_health_data_standard_profile_statistics", count(*) as row_num from szwx.wtj_public_health_data_standard_profile_statistics union all select "wtj_public_health_data_tcm_health_service_statistics", count(*) as row_num from szwx.wtj_public_health_data_tcm_health_service_statistics union all select "xczx_dwd_wx_project_stats", count(*) as row_num from szwx.xczx_dwd_wx_project_stats union all select "xczx_hamlet_type_statistics", count(*) as row_num from szwx.xczx_hamlet_type_statistics union all select "xczx_poverty_mem_statistics", count(*) as row_num from szwx.xczx_poverty_mem_statistics union all select "xczx_project_cc_statistics", count(*) as row_num from szwx.xczx_project_cc_statistics union all select "xczx_village_db_statistics", count(*) as row_num from szwx.xczx_village_db_statistics union all select "xczx_village_work_statistics", count(*) as row_num from szwx.xczx_village_work_statistics union all select "ybj_dwd_wx_medical_insurance_data", count(*) as row_num from szwx.ybj_dwd_wx_medical_insurance_data union all select "yjj_dwd_wx_shelter", count(*) as row_num from szwx.yjj_dwd_wx_shelter 

执行输出

 

相关文章:

统计Mysql库中每个表的总行数,解决table_rows不准确问题

1、拼接SQL selectsubstring( GROUP_CONCAT(a.sf SEPARATOR ),1,length(GROUP_CONCAT(a.sf SEPARATOR ))-10) as sql_str from( select concat(select ", TABLE_name , ", count(*) as row_num from , TABLE_SCHEMA, .,TABLE_name, union all ) as sf frominformat…...

AWS EC2 docker-compose部署MongoDB4.2

环境准备 安装docker 参考EC2官方文档:创建容器镜像以在 Amazon ECS 上使用 - Amazon Elastic Container Service sudo yum update -y sudo amazon-linux-extras install docker sudo usermod -a -G docker ec2-user sudo systemctl enable docker sudo systemct…...

IDEA常用插件之类Jar包搜索Maven Search

文章目录 IDEA常用插件之类Jar包搜索Maven Search说明安装插件使用方法1.搜索自己要搜的jar包2.根据类名搜索 IDEA常用插件之类Jar包搜索Maven Search 说明 它可以帮助用户快速查找和浏览Maven中央存储库中可用的依赖项和插件。它可以帮助用户更方便地管理项目依赖项。 安装…...

使用proxman对iOS真机进行抓包

1 打开手机的safari 输入地址 http://proxy.man/ssl 2 下载证书代开设置页面,安装证书 设置信任证书 打开手机设置 ,点击通用 点击关于本机、 点击证书信任设置 打开信任设置开关 4 设置手机代理 查看需要设置的代理地址 打开界面 在手机中按…...

sdk manager (ubuntu20.4) 安装

1、首先下载sdk manager 1.9.3 下载链接 https://www.baidu.com/link?urlVXJhUqxxhS3eFK3bOPTzi5LFl6ybeW3JwDY1CwANaPf1gvO3IxQKzY547NIe53x1blJxnAXg7FTRTvs-cnfnVa&wd&eqida22baa7b0004ca980000000664e2d426 当然要登录自己的账号才能成功下载,下载对应…...

Oracle修改字符集为SIMPLIFIED CHINESE_CHINA.ZHS16GBK

查询字符集 select userenv(language) from dual;修改前字符集为:SIMPLIFIED CHINESE_CHINA.AL32UTF8 SQL> shutdown immediate; Database closed. Database dismounted. ORACLE instance shut down. SQL> startup mount; ORACLE instance started. Total …...

函数的参数传递和返回值-PHP8知识详解

本文学习的是《php8知识详解》中的《函数的参数传递和返回值》。主要包括:向函数传递参数值、向函数传递参数引用、函数的返回值。 1、向函数传递参数值 函数是一段封闭的程序,有时候,程序员需要向函数传递一些数据进行操作。可以接受传入参…...

【Redis】 Redis短连接的性能优化

Redis短连接的性能优化 1. 问题 通过历史监控我们可以发现用户在频繁使用短连接的时候Redis的cpu使用率有显著的上升 2. 排查 通过扁鹊查看但是Redis的cpu运行情况如下 从扁鹊我们可以看到Redis在freeClient的时候会频繁调用listSearchKey,并且该函数占用了百分…...

无涯教程-分类算法 - 逻辑回归

逻辑回归是一种监督学习分类算法,用于预测目标变量的概率,目标或因变量的性质是二分法,这意味着将只有两种可能的类。 简而言之,因变量本质上是二进制的,其数据编码为1(代表成功/是)或0(代表失败/否)。 在数学上&…...

URL中传递JSON字符串

今天遇见了一个需求,从post请求中在url里传递json字符串, 就是路径?参数11那种情况 最后怎么解决的呢? 需要使用前端方法,先用JSON.stringify格式化成字符串,再用encodeURIComponent把JSON里面的符号转转为url支持的…...

Python Opencv实践 - Sobel边缘检测

import cv2 as cv import numpy as np import matplotlib.pyplot as pltimg cv.imread("../SampleImages/pomeranian.png", cv.IMREAD_GRAYSCALE) print(img.shape)#Sobel边缘检测 #cv.sobel( src, ddepth, dx, dy[,ksize[, scale[, delta[, borderType]]]] ) #src:…...

IDEA快速设置Services窗口

现在微服务下面会有很多SpringBoot服务,Services窗口方便我们管理各个SpringBoot服务,但有时IDEA打开项目后无法的看到Services窗口,以下步骤可以解决!...

【CSS】CSS 背景设置 ( 背景半透明设置 )

一、背景半透明设置 1、语法说明 背景半透明设置 可以 使用 rgba 颜色值设置半透明背景 ; 下面的 CSS 样式中 , 就是 设置黑色背景 , 透明度为 20% ; background: rgba(0, 0, 0, 0.2);颜色的透明度 alpha 取值范围是 0 ~ 1 之间 , 在使用时 , 可以 省略 0.x 前面的 0 , 直接…...

基于android的学生公寓后勤系统/学生公寓管理系统APP

摘 要 随着网络科技的发展,移动智能终端逐渐走进人们的视线,相关应用越来越广泛,并在人们的日常生活中扮演着越来越重要的角色。因此,关键应用程序的开发成为影响移动智能终端普及的重要因素,设计并开发实用、方便的应…...

跳跃游戏 II

跳跃游戏 II 题目: 给定一个长度为 n 的 0 索引整数数组 nums。初始位置为 nums[0]。每个元素 nums[i] 表示从索引 i 向前跳转的最大长度。换句话说&#xff0c;如果你在 nums[i] 处&#xff0c;你可以跳转到任意 nums[i j] 处:0 < j < nums[i] i j < n 返回到达…...

GPT教我学Vue-Router

文章目录 路由的基本配置路由嵌套路由守卫路由参数编程式导航 路由的基本知识点 Vue Router 是 Vue.js 官方的路由管理器。它允许你在 Vue 应用程序中构建单页面应用&#xff08;SPA&#xff09;&#xff0c;并实现了客户端路由功能。下面是一些 Vue Router 的重要知识点&#…...

Tokenview再度升级:全新Web3开发者APIs数据服务体验!

Tokenview发布全新版本的区块链APIs和数据服务平台&#xff0c;为开发者打造更强大、更便捷的开发体验&#xff01; 此次升级&#xff0c;我们整合了开发者使用习惯以及Tokenview产品优势。我们深知对于开发者来说&#xff0c;时间是非常宝贵的&#xff0c;因此我们努力提供一…...

什么是原型链(Prototype Chain)?它在JavaScript中有什么作用?请解释一下JavaScript中的“this”关键字的含义和用法。

1、什么是原型链(Prototype Chain)&#xff1f;它在JavaScript中有什么作用&#xff1f; 原型链&#xff08;Prototype Chain&#xff09;是一种在JavaScript中创建对象的方式&#xff0c;它允许我们通过继承来扩展对象的属性和方法。 在原型链中&#xff0c;每个对象都有一个…...

JS-this知识点、面试题

一、this指向什么 1.简介 2.规则一&#xff1a;默认绑定 3.规则二&#xff1a;隐式绑定 4.规则四&#xff1a;new绑定 5.规则三&#xff1a;显式绑定 call、apply、bind 6.内置函数的绑定 7.规则优先级 8.this规则之外--es6剪头函数 9.ES6剪头函数this 二、This面试题 面试题…...

【C++入门到精通】C++入门 —— 多态(抽象类和虚函数的魅力)

阅读导航 前言一、多态的概念1. 概念2. 多态的特点 二、多态的定义及实现1. 多态的构成条件2. 虚函数3. 虚函数的重写⭕虚函数重写的两个例外1.协变(基类与派生类虚函数返回值类型不同)2.析构函数的重写(基类与派生类析构函数的名字不同) 4. override 和 final&#xff08;C11 …...

【Axure高保真原型】引导弹窗

今天和大家中分享引导弹窗的原型模板&#xff0c;载入页面后&#xff0c;会显示引导弹窗&#xff0c;适用于引导用户使用页面&#xff0c;点击完成后&#xff0c;会显示下一个引导弹窗&#xff0c;直至最后一个引导弹窗完成后进入首页。具体效果可以点击下方视频观看或打开下方…...

vscode里如何用git

打开vs终端执行如下&#xff1a; 1 初始化 Git 仓库&#xff08;如果尚未初始化&#xff09; git init 2 添加文件到 Git 仓库 git add . 3 使用 git commit 命令来提交你的更改。确保在提交时加上一个有用的消息。 git commit -m "备注信息" 4 …...

盘古信息PCB行业解决方案:以全域场景重构,激活智造新未来

一、破局&#xff1a;PCB行业的时代之问 在数字经济蓬勃发展的浪潮中&#xff0c;PCB&#xff08;印制电路板&#xff09;作为 “电子产品之母”&#xff0c;其重要性愈发凸显。随着 5G、人工智能等新兴技术的加速渗透&#xff0c;PCB行业面临着前所未有的挑战与机遇。产品迭代…...

五年级数学知识边界总结思考-下册

目录 一、背景二、过程1.观察物体小学五年级下册“观察物体”知识点详解&#xff1a;由来、作用与意义**一、知识点核心内容****二、知识点的由来&#xff1a;从生活实践到数学抽象****三、知识的作用&#xff1a;解决实际问题的工具****四、学习的意义&#xff1a;培养核心素养…...

剑指offer20_链表中环的入口节点

链表中环的入口节点 给定一个链表&#xff0c;若其中包含环&#xff0c;则输出环的入口节点。 若其中不包含环&#xff0c;则输出null。 数据范围 节点 val 值取值范围 [ 1 , 1000 ] [1,1000] [1,1000]。 节点 val 值各不相同。 链表长度 [ 0 , 500 ] [0,500] [0,500]。 …...

12.找到字符串中所有字母异位词

&#x1f9e0; 题目解析 题目描述&#xff1a; 给定两个字符串 s 和 p&#xff0c;找出 s 中所有 p 的字母异位词的起始索引。 返回的答案以数组形式表示。 字母异位词定义&#xff1a; 若两个字符串包含的字符种类和出现次数完全相同&#xff0c;顺序无所谓&#xff0c;则互为…...

智能仓储的未来:自动化、AI与数据分析如何重塑物流中心

当仓库学会“思考”&#xff0c;物流的终极形态正在诞生 想象这样的场景&#xff1a; 凌晨3点&#xff0c;某物流中心灯火通明却空无一人。AGV机器人集群根据实时订单动态规划路径&#xff1b;AI视觉系统在0.1秒内扫描包裹信息&#xff1b;数字孪生平台正模拟次日峰值流量压力…...

R 语言科研绘图第 55 期 --- 网络图-聚类

在发表科研论文的过程中&#xff0c;科研绘图是必不可少的&#xff0c;一张好看的图形会是文章很大的加分项。 为了便于使用&#xff0c;本系列文章介绍的所有绘图都已收录到了 sciRplot 项目中&#xff0c;获取方式&#xff1a; R 语言科研绘图模板 --- sciRplothttps://mp.…...

【SpringBoot自动化部署】

SpringBoot自动化部署方法 使用Jenkins进行持续集成与部署 Jenkins是最常用的自动化部署工具之一&#xff0c;能够实现代码拉取、构建、测试和部署的全流程自动化。 配置Jenkins任务时&#xff0c;需要添加Git仓库地址和凭证&#xff0c;设置构建触发器&#xff08;如GitHub…...

ZYNQ学习记录FPGA(一)ZYNQ简介

一、知识准备 1.一些术语,缩写和概念&#xff1a; 1&#xff09;ZYNQ全称&#xff1a;ZYNQ7000 All Pgrammable SoC 2&#xff09;SoC:system on chips(片上系统)&#xff0c;对比集成电路的SoB&#xff08;system on board&#xff09; 3&#xff09;ARM&#xff1a;处理器…...