当前位置:网站首页>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 ??
边栏推荐
- pyflink的安装和测试
- LLDP兼容CDP功能配置
- [JS] obtain the N days before and after the current time or the n months before and after the current time (hour, minute, second, year, month, day)
- 一行代码实现地址信息解析
- 斗地主游戏的案例开发
- Mongodb client operation (mongorepository)
- Part V: STM32 system timer and general timer programming
- A brief history of deep learning (II)
- 批量获取中国所有行政区域经边界纬度坐标(到县区级别)
- golang中的Mutex原理解析
猜你喜欢
第五篇,STM32系统定时器和通用定时器编程
[HFCTF2020]BabyUpload session解析引擎
BFS realizes breadth first traversal of adjacency matrix (with examples)
Force buckle 1037 Effective boomerang
The MySQL database in Alibaba cloud was attacked, and finally the data was found
View remote test data and records anytime, anywhere -- ipehub2 and ipemotion app
Make a simple graphical interface with Tkinter
系统休眠文件可以删除吗 系统休眠文件怎么删除
Part V: STM32 system timer and general timer programming
Part IV: STM32 interrupt control programming
随机推荐
Rainstorm effect in levels - ue5
"Exquisite store manager" youth entrepreneurship incubation camp - the first phase of Shunde market has been successfully completed!
Provincial and urban level three coordinate boundary data CSV to JSON
pyflink的安装和测试
Informatics Orsay Ibn YBT 1172: find the factorial of n within 10000 | 1.6 14: find the factorial of n within 10000
通过串口实现printf函数,中断实现串口数据接收
Part 7: STM32 serial communication programming
重上吹麻滩——段芝堂创始人翟立冬游记
[batch dos-cmd command - summary and summary] - view or modify file attributes (attrib), view and modify file association types (Assoc, ftype)
[JS] obtain the N days before and after the current time or the n months before and after the current time (hour, minute, second, year, month, day)
What are the differences between Oracle Linux and CentOS?
Let's talk about 15 data source websites I often use
UI控件Telerik UI for WinForms新主题——VS2022启发式主题
JTAG debugging experience of arm bare board debugging
ESP Arduino (IV) PWM waveform control output
Deeply explore the compilation and pile insertion technology (IV. ASM exploration)
Batch obtain the latitude coordinates of all administrative regions in China (to the county level)
线段树(SegmentTree)
Installation of torch and torch vision in pytorch
The MySQL database in Alibaba cloud was attacked, and finally the data was found