当前位置:网站首页>MySQL script batch queries all tables containing specified field types in the database
MySQL script batch queries all tables containing specified field types in the database
2022-07-07 01:15:00 【Chen Li Li】
Due to changes in project requirements , You need to regenerate the code with the table ,text The entity code generated by type reverse engineering will be separated from other types of entities , In order to find out all the contents text Table of fields . Checked and wrote the information , Sort out the query script , Note the . It will inevitably be used again in the future .
List of articles
Query field name and field type
Query all field names and field types in the specified database
SELECT COLUMN_NAME,DATA_TYPE FROM information_schema.COLUMNS WHERE table_schema =' Library name '
Query the table containing the specified field type
mysql The script queries all tables in the database that contain the specified field type
With text Type as an example
Query all the contents in the Library text Type field
SELECT COLUMN_NAME,DATA_TYPE FROM information_schema.COLUMNS WHERE table_schema =' Library name ' AND DATA_TYPE = ' Field type '
Query results :
ver_detail text
ver_url text
menu_desc text
menu_pic text
menu_url text
role_desc text
rule_desc text
rule_txt text
express_name text
mail_body_template text
remark text
send_bean text
msg_site_template text
remark text
remark text
sms_template text
param_desc text
sp_desc text
sql_load text
sp_desc text
oth_params text
url text
para_desc text
para_value text
link_name text
Query all tables with a certain field under the Library
Query all tables with a certain field under the Library
SELECT TABLE_NAME,column_name,data_type,column_type,column_comment FROM information_schema.columns WHERE column_name=' Field ' AND TABLE_SCHEMA=' Library name '
Query results :
t_app_version ver_detail text text
Organize batch scripts
Batch query all tables containing specified field types in the database
SELECT DISTINCT
TABLE_NAME,
column_name,
data_type,
column_type,
column_comment
FROM
information_schema.COLUMNS
WHERE
column_name IN ( SELECT COLUMN_NAME FROM information_schema.COLUMNS WHERE table_schema = ' Library name ' AND DATA_TYPE = ' Field type ' )
AND TABLE_SCHEMA = ' Library name '
AND DATA_TYPE = ' Field type '
Return results :
t_auth_menu menu_desc text text ????
t_auth_menu menu_pic text text ??????????????URL?
t_auth_role role_desc text text ????
t_auth_rule rule_desc text text ????
t_auth_rule rule_txt text text ????
t_base_express express_name text text ??????????
t_base_msg_mail mail_body_template text text ??????
t_base_msg_mail remark text text ??
t_base_msg_send_type send_bean text text ???????Bean
t_base_msg_site msg_site_template text text ?????
t_base_msg_site remark text text ??
t_base_msg_sms sms_template text text ????
t_base_msg_sms remark text text ??
边栏推荐
- Periodic flash screen failure of Dell notebook
- Link sharing of STM32 development materials
- Return to blowing marshland -- travel notes of zhailidong, founder of duanzhitang
- [Batch dos - cmd Command - Summary and Summary] - String search, find, Filter Commands (FIND, findstr), differentiation and Analysis of Find and findstr
- Openjudge noi 1.7 08: character substitution
- 第四篇,STM32中断控制编程
- 重上吹麻滩——段芝堂创始人翟立冬游记
- NEON优化:性能优化常见问题QA
- Deeply explore the compilation and pile insertion technology (IV. ASM exploration)
- Segmenttree
猜你喜欢
线段树(SegmentTree)
Installation and testing of pyflink
Force buckle 1037 Effective boomerang
boot - prometheus-push gateway 使用
ESP Arduino (IV) PWM waveform control output
第六篇,STM32脉冲宽度调制(PWM)编程
Summary of being a microservice R & D Engineer in the past year
[牛客] [NOIP2015]跳石头
Telerik UI 2022 R2 SP1 Retail-Not Crack
Part VI, STM32 pulse width modulation (PWM) programming
随机推荐
Address information parsing in one line of code
详解OpenCV的矩阵规范化函数normalize()【范围化矩阵的范数或值范围(归一化处理)】,并附NORM_MINMAX情况下的示例代码
The difference between spin and sleep
Part 7: STM32 serial communication programming
from .cv2 import * ImportError: libGL.so.1: cannot open shared object file: No such file or direc
第五篇,STM32系统定时器和通用定时器编程
【JVM调优实战100例】05——方法区调优实战(下)
Chenglian premium products has completed the first step to enter the international capital market by taking shares in halber international
动态规划思想《从入门到放弃》
Activereportsjs 3.1 Chinese version | | | activereportsjs 3.1 English version
斗地主游戏的案例开发
Building a dream in the digital era, the Xi'an station of the city chain science and Technology Strategy Summit ended smoothly
paddlehub应用出现paddle包报错的问题
《安富莱嵌入式周报》第272期:2022.06.27--2022.07.03
Fastdfs data migration operation record
NEON优化:性能优化经验总结
"Exquisite store manager" youth entrepreneurship incubation camp - the first phase of Shunde market has been successfully completed!
Oracle:CDB限制PDB资源实战
A brief history of deep learning (II)
省市区三级坐标边界数据csv转JSON