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

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

时间:2025-11-05 04:29:46 来源:益强数据堂 作者:IT科技 阅读:779次

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

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

table_name

from information_schema.tables

where table_type = BASE TABLE

and table_name rlike ([0-9])

order by table_schema,

table_name;

说明:

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

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

tab.table_name

from information_schema.tables as tab

inner join information_schema.columns as col

on col.table_schema = tab.table_schema

and col.table_name = tab.table_name

where tab.table_type = BASE TABLE

and column_name = idcity

order by tab.table_schema,

tab.table_name;

说明:

database_name - 找到表的数据库(模式)的名称table_name - 找到的亿华云计算表的名称

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

tab.table_name

from information_schema.tables tab

left 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 here

where tab.table_schema not in (information_schema, mysql,

performance_schema, sys)

and tab.table_type = BASE TABLE

and col.column_name is null

order by tab.table_schema,

tab.table_name;

说明:

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

(责任编辑:IT科技类资讯)

推荐内容
  • 如何通过改机械键盘音效提升打字体验(利用电脑键盘改造教程打造个性化机械音效)
  • windows 7系统长时间未登录密码已过期该怎么办?
  • windows7系统备份使用的方法
  • Windows7下70个技巧和窍门
  • 电脑操作指南(教您快速、简单地通过电脑修改WiFi密码)
  • windows 7系统双硬盘停止启动噪音太大该怎么解决?