查询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中 如何查询表名中包含某字段的表的更多相关文章

  1. MySQL中 如何查询表名中包含某字段的表 ,查询MySql数据库架构信息:数据库,表,表字段

    --查询tablename 数据库中 以"_copy" 结尾的表 select table_name from information_schema.tables where ta ...

  2. Oracle 查询表的索引包含的字段

    Oracle 查询表的索引包含的字段 select a.uniqueness 索引类型,b.index_name 索引名称,b.column_name 字段 from user_indexes a , ...

  3. oracle 查看表是否存在、包含某字段的表、表是否包含字段

    表是否存在: select count(*) from user_tables where table_name = #{tablename} 包含某个字段的表 select * from user_ ...

  4. 【LOB】使用USER_LOBS视图获得当前用户包含LOB字段的表

    包含LOB类型字段的表往往需要特殊关照,如何快速的获得包含LOB对象的数据库表?使用DBA_LOBS.ALL_LOBS和USER_LOBS视图可以很方便地获得包含BLOB或CLOB字段的表. 简单看一 ...

  5. SQLserver查询库中包含某个字段的表

    select [name] from [TPMS_PRD].[dbo].sysobjects where id in(select id from [TPMS_PRD].[dbo].syscolumn ...

  6. 查询SQL中某表里有多少列包含某字段

    select c.name from SYSCOLUMNS as c left join SYSOBJECTS as t on c.id=t.id where c.name like '这里是某个字段 ...

  7. oracle查询包含某个字段的表

    select column_name,table_name,data_type ,data_length,data_precision,data_scale from DBA_TAB_COLUMNS ...

  8. 包含Blob字段的表无法Export/Import

    最近一直用MySQL-Front的导出导出工具完成数据库的备份,确实比较方便快捷. 后来增加了一张表,其中有blob字段,上传几个文件后,发现导出不好用了,进度条长期处于停滞状态. 想想也是,要把bl ...

  9. sql server 查询某数据库中包含某字段的所有表格

    场景:查询DNMes数据库中所有包含RFID字段的表名 sql语句: select object_name(id) objName,Name as colName from syscolumns wh ...

随机推荐

  1. c语言之sizeof的细节

    关于sizeof,我们知道sizeof并不是一个函数,尽管通常我们会用sizeof()用法(这是c语言的坑),在此关于sizeof的一些关键不被认知的进行一下总结: # include "i ...

  2. Day8 Python基础之遗漏知识点(六)

    1. 遗漏知识点 深.浅拷贝:   http://www.cnblogs.com/yuanchenqi/articles/5782764.html a=b: 浅拷贝: 深拷贝 集合(set) 集合的定 ...

  3. P124黎曼可积性刻画 的两个备注

    1.这里为什么是开集?   2.请问为什么说了是开集马上就说是有界可测函数? 开集为可测集

  4. 自己实现数据结构系列五---BinarySearchTree

    一.二分搜索树: 1.代码: public class BST<E extends Comparable<E>> { private class Node{ public E ...

  5. PAT L3-016 二叉搜索树的结构

    https://pintia.cn/problem-sets/994805046380707840/problems/994805047903240192 二叉搜索树或者是一棵空树,或者是具有下列性质 ...

  6. pip Read timed out 和 pip 源

    解决方法,设置超时时间 pip --default-timeout=100 install -U Pillow 安装时指定源(--index-url) #例如安装scipy时使用豆瓣的源 pip in ...

  7. windows 内建环境变量

    PS C:\Windows> ls env: Name Value ---- ----- _NT_SYMBOL_PATH srv*C:\Users\vv\Documents\symbols AL ...

  8. 【转帖】Linux定时任务Crontab命令详解

    Linux定时任务Crontab命令详解 https://www.cnblogs.com/intval/p/5763929.html 知道有crontab 以及 at 命令 改天仔细学习一下 讲sys ...

  9. [转帖]IP /TCP协议及握手过程和数据包格式中级详解

    IP /TCP协议及握手过程和数据包格式中级详解 https://www.toutiao.com/a6665292902458982926/ 写的挺好的 其实 一直没闹明白 网络好 广播地址 还有 网 ...

  10. Laravel技巧:使用load、with预加载 区别

    1.使用load $posts = Post::all(); $posts->load('user'); 2.使用with $posts = Post::with('user')->all ...