当前位置: 首页 > 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 …...

脑机新手指南(八):OpenBCI_GUI:从环境搭建到数据可视化(下)

一、数据处理与分析实战 &#xff08;一&#xff09;实时滤波与参数调整 基础滤波操作 60Hz 工频滤波&#xff1a;勾选界面右侧 “60Hz” 复选框&#xff0c;可有效抑制电网干扰&#xff08;适用于北美地区&#xff0c;欧洲用户可调整为 50Hz&#xff09;。 平滑处理&…...

反向工程与模型迁移:打造未来商品详情API的可持续创新体系

在电商行业蓬勃发展的当下&#xff0c;商品详情API作为连接电商平台与开发者、商家及用户的关键纽带&#xff0c;其重要性日益凸显。传统商品详情API主要聚焦于商品基本信息&#xff08;如名称、价格、库存等&#xff09;的获取与展示&#xff0c;已难以满足市场对个性化、智能…...

逻辑回归:给不确定性划界的分类大师

想象你是一名医生。面对患者的检查报告&#xff08;肿瘤大小、血液指标&#xff09;&#xff0c;你需要做出一个**决定性判断**&#xff1a;恶性还是良性&#xff1f;这种“非黑即白”的抉择&#xff0c;正是**逻辑回归&#xff08;Logistic Regression&#xff09;** 的战场&a…...

【入坑系列】TiDB 强制索引在不同库下不生效问题

文章目录 背景SQL 优化情况线上SQL运行情况分析怀疑1:执行计划绑定问题?尝试:SHOW WARNINGS 查看警告探索 TiDB 的 USE_INDEX 写法Hint 不生效问题排查解决参考背景 项目中使用 TiDB 数据库,并对 SQL 进行优化了,添加了强制索引。 UAT 环境已经生效,但 PROD 环境强制索…...

【HarmonyOS 5.0】DevEco Testing:鸿蒙应用质量保障的终极武器

——全方位测试解决方案与代码实战 一、工具定位与核心能力 DevEco Testing是HarmonyOS官方推出的​​一体化测试平台​​&#xff0c;覆盖应用全生命周期测试需求&#xff0c;主要提供五大核心能力&#xff1a; ​​测试类型​​​​检测目标​​​​关键指标​​功能体验基…...

基于uniapp+WebSocket实现聊天对话、消息监听、消息推送、聊天室等功能,多端兼容

基于 ​UniApp + WebSocket​实现多端兼容的实时通讯系统,涵盖WebSocket连接建立、消息收发机制、多端兼容性配置、消息实时监听等功能,适配​微信小程序、H5、Android、iOS等终端 目录 技术选型分析WebSocket协议优势UniApp跨平台特性WebSocket 基础实现连接管理消息收发连接…...

可靠性+灵活性:电力载波技术在楼宇自控中的核心价值

可靠性灵活性&#xff1a;电力载波技术在楼宇自控中的核心价值 在智能楼宇的自动化控制中&#xff0c;电力载波技术&#xff08;PLC&#xff09;凭借其独特的优势&#xff0c;正成为构建高效、稳定、灵活系统的核心解决方案。它利用现有电力线路传输数据&#xff0c;无需额外布…...

Go 语言接口详解

Go 语言接口详解 核心概念 接口定义 在 Go 语言中&#xff0c;接口是一种抽象类型&#xff0c;它定义了一组方法的集合&#xff1a; // 定义接口 type Shape interface {Area() float64Perimeter() float64 } 接口实现 Go 接口的实现是隐式的&#xff1a; // 矩形结构体…...

前端导出带有合并单元格的列表

// 导出async function exportExcel(fileName "共识调整.xlsx") {// 所有数据const exportData await getAllMainData();// 表头内容let fitstTitleList [];const secondTitleList [];allColumns.value.forEach(column > {if (!column.children) {fitstTitleL…...

深入理解JavaScript设计模式之单例模式

目录 什么是单例模式为什么需要单例模式常见应用场景包括 单例模式实现透明单例模式实现不透明单例模式用代理实现单例模式javaScript中的单例模式使用命名空间使用闭包封装私有变量 惰性单例通用的惰性单例 结语 什么是单例模式 单例模式&#xff08;Singleton Pattern&#…...