会员登录 - 用户注册 - 设为首页 - 加入收藏 - 网站地图 MySQL关于查找模式对象的语句!

MySQL关于查找模式对象的语句

时间:2025-11-04 23:05:52 来源:益强数据堂 作者:域名 阅读:609次

在日常工作中,于查语句搜索特定的找模数据库对象,是式对最常见的一个工作,下面分享几个关于mysql模式查找的于查语句语句。

1. 在 MySQL 数据库中查找名称中包含数字的服务器租用找模表 复制select table_schema as database_name

,

table_namefrom information_schema.tableswhere table_type = BASE TABLE and table_name rlike ([0-9]

)

order by table_schema

,

table_name;1.2.3.4.5.6.7.

说明:

database_name - 找到表的数据库(模式)的名称table_name - 找到的表的名称

2. 在 MySQL 数据库中查找关于特定列名的表 复制select tab.table_schema as database_name

,

tab.table_namefrom information_schema.tables as tabinner join information_schema.columns as col on col.table_schema = tab.table_schema and col.table_name = tab.table_namewhere tab.table_type = BASE TABLE and column_name = idcityorder by tab.table_schema

,

tab.table_name;1.2.3.4.5.6.7.8.9.10.

说明:

database_name - 找到表的数据库(模式)的名称table_name - 找到的IT技术网表的名称

3. 在 MySQL 数据库中查找没有特定名称的列的表 复制select tab.table_schema as database_name

,

tab.table_namefrom information_schema.tables tableft join information_schema.columns col on tab.table_schema = col.table_schema and tab.table_name = col.table_name and col.column_name = id -- put column name herewhere tab.table_schema not in (information_schema, mysql

,

performance_schema, sys

)

and tab.table_type = BASE TABLE and col.column_name is nullorder by tab.table_schema

,

tab.table_name;1.2.3.4.5.6.7.8.9.10.11.12.13.

说明:

database_name - 找到的表的数据库(模式)名称table_name - 找到的表的名称​香港云服务器

(责任编辑:IT科技)

推荐内容
  • 移动客服电脑操作教程(让你成为电脑操作高手)
  • 医疗保健科技公司遭遇网络攻击,预计影响 450 万客户
  • 图数据库的发展脉络与技术演进
  • 谷歌OAuth验证系统曝零日漏洞,可被黑客用于账户劫持
  • 电脑wis系统安装教程(电脑wis系统安装详解,助你提升工作效率与便捷性)
  • 卸载掉Navicat,有免费的DBeaver就够了