当前位置:网站首页>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 ??
边栏推荐
- [batch dos-cmd command - summary and summary] - view or modify file attributes (attrib), view and modify file association types (Assoc, ftype)
- NEON优化:log10函数的优化案例
- ZABBIX 5.0: automatically monitor Alibaba cloud RDS through LLD
- ARM裸板调试之JTAG原理
- Cause of handler memory leak
- Informatics Olympiad YBT 1171: factors of large integers | 1.6 13: factors of large integers
- Address information parsing in one line of code
- Tensorflow 1.14 specify GPU running settings
- The cost of returning tables in MySQL
- Summary of being a microservice R & D Engineer in the past year
猜你喜欢
UI控件Telerik UI for WinForms新主题——VS2022启发式主题
「精致店主理人」青年创业孵化营·首期顺德场圆满结束!
Data type of pytorch tensor
Windows installation mysql8 (5 minutes)
资产安全问题或制约加密行业发展 风控+合规成为平台破局关键
Boot - Prometheus push gateway use
[100 cases of JVM tuning practice] 05 - Method area tuning practice (Part 2)
【JVM调优实战100例】04——方法区调优实战(上)
Dynamic planning idea "from getting started to giving up"
城联优品入股浩柏国际进军国际资本市场,已完成第一步
随机推荐
第四篇,STM32中断控制编程
"Exquisite store manager" youth entrepreneurship incubation camp - the first phase of Shunde market has been successfully completed!
pyflink的安装和测试
[100 cases of JVM tuning practice] 05 - Method area tuning practice (Part 2)
Chenglian premium products has completed the first step to enter the international capital market by taking shares in halber international
动态规划思想《从入门到放弃》
golang中的Mutex原理解析
Asset security issues or constraints on the development of the encryption industry, risk control + compliance has become the key to breaking the platform
Part 7: STM32 serial communication programming
Rainstorm effect in levels - ue5
tensorflow 1.14指定gpu运行设置
第三方跳转网站 出现 405 Method Not Allowed
Data type of pytorch tensor
A brief history of deep learning (I)
Dell Notebook Periodic Flash Screen Fault
第六篇,STM32脉冲宽度调制(PWM)编程
通过串口实现printf函数,中断实现串口数据接收
[Niuke] [noip2015] jumping stone
Oracle: Practice of CDB restricting PDB resources
Atomic in golang and CAS operations