MySQL中 如何查询表名中包含某字段的表
查询tablename 数据库中 以"_copy" 结尾的表
select table_name from information_schema.tables where table_schema='tablename' and table_type='base table' and table_name like '%_copy';
information_schema 是MySQL系统自带的数据库,提供了对数据库元数据的访问
information_schema.tables 指数据库中的表(information_schema.columns 指列)
table_schema 指数据库的名称
table_type 指是表的类型(base table 指基本表,不包含系统表)
table_name 指具体的表名
如果本身是在tablename 这个库里新建的查询,可以去掉 table_schema='tablename ' 这一句
select table_name from information_schema.tables where table_type='base table' and table_name like '%_copy';
在Informix数据库中,如何查询表名中包含某字段的表
select * from systables where tabname like 'saa%'
此法只对Informix数据库有用
查询指定数据库中指定表的所有字段名column_name
select column_name from information_schema.columns where table_schema='csdb' and table_name='xxx'
检查数据库'test'中的某一个表'd_ad'是否存在
select count(1) from information_schema.tables where table_schema = 'test' and table_name = 'd_ad';
如何查询mysql数据库中有多少张表
select count(*) TABLES, table_schema from information_schema.tables where table_schema = 'test' group by table_schema;
参考:
[1].https://blog.csdn.net/zhanglehes/article/details/18603641
[2].https://blog.csdn.net/yuxiongjie/article/details/45486033
等
MySQL中 如何查询表名中包含某字段的表的更多相关文章
- MySQL中 如何查询表名中包含某字段的表 ,查询MySql数据库架构信息:数据库,表,表字段
--查询tablename 数据库中 以"_copy" 结尾的表 select table_name from information_schema.tables where ta ...
- Oracle 查询表的索引包含的字段
Oracle 查询表的索引包含的字段 select a.uniqueness 索引类型,b.index_name 索引名称,b.column_name 字段 from user_indexes a , ...
- oracle 查看表是否存在、包含某字段的表、表是否包含字段
表是否存在: select count(*) from user_tables where table_name = #{tablename} 包含某个字段的表 select * from user_ ...
- 【LOB】使用USER_LOBS视图获得当前用户包含LOB字段的表
包含LOB类型字段的表往往需要特殊关照,如何快速的获得包含LOB对象的数据库表?使用DBA_LOBS.ALL_LOBS和USER_LOBS视图可以很方便地获得包含BLOB或CLOB字段的表. 简单看一 ...
- SQLserver查询库中包含某个字段的表
select [name] from [TPMS_PRD].[dbo].sysobjects where id in(select id from [TPMS_PRD].[dbo].syscolumn ...
- 查询SQL中某表里有多少列包含某字段
select c.name from SYSCOLUMNS as c left join SYSOBJECTS as t on c.id=t.id where c.name like '这里是某个字段 ...
- oracle查询包含某个字段的表
select column_name,table_name,data_type ,data_length,data_precision,data_scale from DBA_TAB_COLUMNS ...
- 包含Blob字段的表无法Export/Import
最近一直用MySQL-Front的导出导出工具完成数据库的备份,确实比较方便快捷. 后来增加了一张表,其中有blob字段,上传几个文件后,发现导出不好用了,进度条长期处于停滞状态. 想想也是,要把bl ...
- sql server 查询某数据库中包含某字段的所有表格
场景:查询DNMes数据库中所有包含RFID字段的表名 sql语句: select object_name(id) objName,Name as colName from syscolumns wh ...
随机推荐
- 使用Comparable接口自定义排序
Employee: package textq; /** * 调用接口Comparable排序 * @author Administrator * */ public class Employee i ...
- Yii1.1框架实现PHP极光推送消息通知
一.下载极光推送PHP SDK,解压后放在/protected/components/目录下,如下图所示: 二.完善修改下官方的demo例子,我这里复制一份demo,改为NotifyPush.php, ...
- Python容器
列表 list 1.列表的格式为,把值放入[ ]中 >>> lis = ['a', 1, ['a', 'c', 1]] 2.列表中可以嵌套任何类型 索引 因为列表是有序的,那么我们可 ...
- UITableView套UITableView数据刷新
https://www.jianshu.com/p/ee4b2bd54d08 网上关于tableview嵌套tableview的文章很多,纵览很多后发现有两点没有满足需求 把两个tableview放在 ...
- Access使用记录
iif函数 此函数类似编程语言中的双目运算符,官方解释如下: 在任何可以使用表达式的位置均可使用 IIf.您可以使用 IIf 确定另一个表达式为 True 还是 False.如果表达式为 True,则 ...
- IdentityServer4【Topic】之确认(Consent)
Consent 确认 在授权请求期间,如果身份服务器需要用户同意,浏览器将被重定向到同意页面.也就是说,确认也算是IdentityServer中的一个动作.确认这个词直接翻译过来有一些古怪,既然大家都 ...
- WSL Windows subsytem linux 的简单学习与使用
1. win10 1709 以上的版本应该都增加上了 ctrl +r 运行 winver 查看版本 2. 添加删除程序 增加 wsl 增加一个功能 3. 打开cmd 输入 bash 即可 4. 可以将 ...
- 转:Flutter Decoration背景设定(边框、圆角、阴影、形状、渐变、背景图像等)
1 继续关系: BoxDecoration:实现边框.圆角.阴影.形状.渐变.背景图像 ShapeDecoration:实现四个边分别指定颜色和宽度.底部线.矩形边色.圆形边色.体育场(竖向椭圆). ...
- Java内存泄漏分析
https://www.javatang.com/archives/2017/11/08/11582145.html?tdsourcetag=s_pcqq_aiomsg
- 用 Python 写一个多进程兼容的 TimedRotatingFileHandler
我前面有篇文章已经详细介绍了一下 Python 的日志模块.Python 提供了非常多的可以运用在各种不同场景的 Log Handler. TimedRotatingFileHandler 是 Pyt ...