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 ...
随机推荐
- hibernate坑边闲话3
could not initialize proxy - no Session] with root cause org.hibernate.LazyInitializationException: ...
- rest-framework总结
1. CBV: pass 2 .APIView class BookView(APIView):pass url(r'^books/$', views.BookView.as_view(),name= ...
- [2017BUAA软工助教]第0次作业小结
BUAA软工第0次作业小结 零.题目 作业链接: This is a hyperlink 一.评分规则 本次作业满分10分: 按时提交有分 一周内补交得0分 超过一周不交或抄袭倒扣全部分数 评分规则如 ...
- 了解真实的rem手机屏幕适配
rem 作为一个低调的长度单位,由于手机端网页的兴起,在屏幕适配中得到重用.使用 rem 前端开发者可以很方便的在各种屏幕尺寸下,通过等比缩放的方式达到设计图要求的效果. rem 的官方定义『The ...
- [转帖]mimikatz 学习
mimikatz mimikatz 2.0 vient de sortir en version alpha binaires : https://github.com/gentilkiwi/mimi ...
- C++多态(静多态和动多态)
如今的C++已经是个多重泛型编程语言(multiparadigm programming lauguage),一个同时支持过程形式(procedural).面向对象形式(object-oriented ...
- Linux安装mysql5.6
安装mysql5.6https://www.cnblogs.com/wangdaijun/p/6132632.html
- class面向对象-1
一.基本定义 class cl(object): def __init(self,var) self.var=var def func(self,i) print('%s is in %s'%(i,s ...
- 前端传送JSON数据,报Required request body is missing
声明: 后端为Java,采用SSM框架 前端一个JSON.stringify()传来的json字符串,后端一般用@RequestBody标签来定义一个参数接收 但问题在于,当我使用get方式传JSON ...
- crontab 从nano 转换为 vim
crontab默认编辑器为nano,不方便使用. 修改crontab默认编辑器为vi或者其他的编辑器. export EDITOR="/usr/bin/vim" ; cront ...