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 ...
随机推荐
- H5 69-清除浮动方式四
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...
- A. Chess Placing
链接 [https://codeforces.com/contest/985/problem/A] 题意 给你一个偶数n,输入n/2个数,代表棋子的位置,有一个1*n的棋盘是黑白相间的 问你使得所有棋 ...
- UnderWater+SDN论文之二
---- Software-defined underwater acoustic networking platform and its applications source: Ad Hoc Ne ...
- Codeforces Round #534 (Div. 2)D. Game with modulo-1104-D(交互+二分+构造)
D. Game with modulo time limit per test 1 second memory limit per test 256 megabytes input standard ...
- latex 图片标题居中
1.有一个全局图片标题居中的方法: \usepackage[justification=centering]{caption} 2.如果排版时有的图标题想左对齐,有的想居中,前一个方法就不好了,这里可 ...
- 【学习总结】C-翁恺老师-入门-第4周<循环控制>
[学习总结]C-翁恺老师-入门-总 1-阶乘:引入for循环 2-控制循环次数:初始化与控制条件的设置 任何一个for循环都可以写成一个while循环 for中的每一个表达式都是可以省略的:for(; ...
- Laravel渴求式加载(比较容易理解理解load与with关系)
渴求式加载 当以属性方式访问 Eloquent关联关系的时候,关联关系数据是「懒惰式加载」的,这意味着关联关系数据直到第一次访问的时候才被加载.不过,Eloquent 还可以在查询父级模型的同时「渴求 ...
- css3 text-shadow字体阴影讲解
text-shadow:为字体添加阴影, 可以通过对text-shadow属性设置相关的属性值,来实现现一些需要的字体阴影效果,减少了图片的使用. 基础说明: text-shadow: X轴 ...
- 剑指offer(12)
来两道关于链表链接的题目: 题目一: 输入两个单调递增的链表,输出两个链表合成后的链表,当然我们需要合成后的链表满足单调不减规则. 本题要考虑到其中一条链表是空或者两个都是空的情况. 在每个链表安上一 ...
- scala flatmap、reduceByKey、groupByKey
1.test.txt文件中存放 asd sd fd gf g dkf dfd dfml dlf dff gfl pkdfp dlofkp // 创建一个Scala版本的Spark Context va ...