当前位置:网站首页>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 ??
边栏推荐
- tensorflow 1.14指定gpu运行设置
- [100 cases of JVM tuning practice] 05 - Method area tuning practice (Part 2)
- 重上吹麻滩——段芝堂创始人翟立冬游记
- 「精致店主理人」青年创业孵化营·首期顺德场圆满结束!
- 迈动互联中标北京人寿保险,助推客户提升品牌价值
- What kind of experience is it to realize real-time collaboration in jupyter
- 接收用户输入,身高BMI体重指数检测小业务入门案例
- Dell笔记本周期性闪屏故障
- A brief history of deep learning (I)
- 第七篇,STM32串口通信编程
猜你喜欢
Boot - Prometheus push gateway use
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
第三方跳转网站 出现 405 Method Not Allowed
Dell笔记本周期性闪屏故障
golang中的Mutex原理解析
第七篇,STM32串口通信编程
省市区三级坐标边界数据csv转JSON
Analysis of mutex principle in golang
UI控件Telerik UI for WinForms新主题——VS2022启发式主题
[batch dos-cmd command - summary and summary] - jump, cycle, condition commands (goto, errorlevel, if, for [read, segment, extract string]), CMD command error summary, CMD error
随机推荐
The difference between spin and sleep
golang中的Mutex原理解析
How do novices get started and learn PostgreSQL?
UI控件Telerik UI for WinForms新主题——VS2022启发式主题
《安富莱嵌入式周报》第272期:2022.06.27--2022.07.03
Deeply explore the compilation and pile insertion technology (IV. ASM exploration)
pytorch之数据类型tensor
深度学习简史(一)
HMM 笔记
Niuke cold training camp 6B (Freund has no green name level)
[Niuke] b-complete square
golang中的atomic,以及CAS操作
Telerik UI 2022 R2 SP1 Retail-Not Crack
[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)
[batch dos-cmd command - summary and summary] - view or modify file attributes (attrib), view and modify file association types (Assoc, ftype)
STM32开发资料链接分享
Activereportsjs 3.1 Chinese version | | | activereportsjs 3.1 English version
C# 计算农历日期方法 2022
Batch obtain the latitude coordinates of all administrative regions in China (to the county level)
ARM裸板调试之JTAG原理