当前位置:网站首页>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 ??

边栏推荐
- The printf function is realized through the serial port, and the serial port data reception is realized by interrupt
- ARM裸板调试之JTAG调试体验
- Activereportsjs 3.1 Chinese version | | | activereportsjs 3.1 English version
- Explain in detail the matrix normalization function normalize() of OpenCV [norm or value range of the scoped matrix (normalization)], and attach norm_ Example code in the case of minmax
- Part V: STM32 system timer and general timer programming
- Maidong Internet won the bid of Beijing life insurance to boost customers' brand value
- Come on, don't spread it out. Fashion cloud secretly takes you to collect "cloud" wool, and then secretly builds a personal website to be the king of scrolls, hehe
- Taro2.* 小程序配置分享微信朋友圈
- 【JVM调优实战100例】04——方法区调优实战(上)
- Segmenttree
猜你喜欢

Part VI, STM32 pulse width modulation (PWM) programming

LLDP兼容CDP功能配置

Come on, don't spread it out. Fashion cloud secretly takes you to collect "cloud" wool, and then secretly builds a personal website to be the king of scrolls, hehe

线段树(SegmentTree)

The MySQL database in Alibaba cloud was attacked, and finally the data was found

Batch obtain the latitude coordinates of all administrative regions in China (to the county level)

Your cache folder contains root-owned files, due to a bug in npm ERR! previous versions of npm which

第四篇,STM32中断控制编程
做微服务研发工程师的一年来的总结
![[100 cases of JVM tuning practice] 04 - Method area tuning practice (Part 1)](/img/7a/bd03943c39d3f731afb51fe2e0f898.png)
[100 cases of JVM tuning practice] 04 - Method area tuning practice (Part 1)
随机推荐
What are the differences between Oracle Linux and CentOS?
Informatics Olympiad YBT 1171: factors of large integers | 1.6 13: factors of large integers
Case development of landlord fighting game
Tensorflow GPU installation
Eventbus source code analysis
The cost of returning tables in MySQL
Installation and testing of pyflink
[Batch dos - cmd Command - Summary and Summary] - String search, find, Filter Commands (FIND, findstr), differentiation and Analysis of Find and findstr
[100 cases of JVM tuning practice] 04 - Method area tuning practice (Part 1)
【案例分享】网络环路检测基本功能配置
BFS realizes breadth first traversal of adjacency matrix (with examples)
Part 7: STM32 serial communication programming
golang中的atomic,以及CAS操作
C# 计算农历日期方法 2022
Openjudge noi 1.7 10: simple password
mysql: error while loading shared libraries: libtinfo.so.5: cannot open shared object file: No such
Pytorch中torch和torchvision的安装
LLDP兼容CDP功能配置
Come on, don't spread it out. Fashion cloud secretly takes you to collect "cloud" wool, and then secretly builds a personal website to be the king of scrolls, hehe
There is an error in the paddehub application