--查询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'
SELECT * FROM information_schema.columns WHERE column_name='brand_id'; --检查数据库'test'中的某一个表'd_ad'是否存在
select count() 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;

-- 查询MySql数据库架构信息:数据库,表,表字段
/*1.查询所有数据库*/
show databases; /*2.查询所有数据表*/
select * from information_schema.tables where table_schema='world' /*3.查询指定表的所有字段*/
select * from information_schema.columns
where table_schema='world'
and table_name='city'

源文:https://www.cnblogs.com/acm-bingzi/p/mysql-information-schema.html

MySQL中 如何查询表名中包含某字段的表 ,查询MySql数据库架构信息:数据库,表,表字段的更多相关文章

  1. MySQL中 如何查询表名中包含某字段的表

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

  2. Oracle中把一张表查询结果插入到另一张表中

      1. 新增一个表,通过另一个表的结构和数据 create table XTHAME.tab1 as select * from DSKNOW.COMBDVERSION 2. 如果表存在: inse ...

  3. mysql结构相同的三张表查询一条记录\将一张表中的数据插入另外一张表

    将一张表中的数据插入另外一张表 1.两张表结构相同 insert into 表1名称 select * from 表2名称 2.两张结构不相同的表 insert into 表1名称(列名1,列名2,列 ...

  4. mysql数据库补充知识3 查询数据库记录信息之多表查询

    一 介绍 准备表 company.employeecompany.department 复制代码 #建表 create table department( id int, name varchar(2 ...

  5. mysql数据库补充知识2 查询数据库记录信息之单表查询

    一 单表查询的语法 SELECT 字段1,字段2... FROM 表名 WHERE 条件 GROUP BY field HAVING 筛选 ORDER BY field LIMIT 限制条数 二 关键 ...

  6. 三十二. 多表查询 MySQL管理工具 、 用户授权及撤销

    1.MySQL管理工具 部署LAMP+phpMyAdmin平台 安装httpd.mysql.php-mysql及相关包 启动httpd服务程序 解压phpMyAdmin包,部署到网站目录 配置conf ...

  7. Linux记录-shell获取hdfs表查询mysql

    #!/bin/sh hdfs dfs -ls /user/hive/warehouse | awk '{print $8}' | awk -F "/" '{print $5}' & ...

  8. 查询MySql数据库架构信息:数据库,表,表字段

    /*1.查询所有数据库*/ show databases;  /*2.查询所有数据表*/ select * from information_schema.tables where table_sch ...

  9. mysql,SQL标准,多表查询中内连接,外连接,自然连接等详解之查询结果集的笛卡尔积的演化

    先附上数据. CREATE TABLE `course` ( `cno` ) NOT NULL, `cname` ) CHARACTER SET utf8 NOT NULL, `ctime` ) NO ...

随机推荐

  1. win7+iis7+asp+.net+php环境配置

    一.我们先来配置一下iis: f 1. 点击[開始]->[控制面板]->点击[程序和功能]进入下一步 2. 然后,在左側点击[打开或关闭Windows功能].然后会跳出来一个框 3. 開始 ...

  2. js数组对象深度复制

    var deepCopy = function(o) { if (o instanceof Array) { var n = []; for (var i = 0; i < o.length; ...

  3. ThinkPHP3.2 新bug ReadHtmlCache 支持不区分大写和小写的函数

    报错提示: Fatal error: Function name must be a string in D:\wwwroot\zbphp.com\ThinkPHP\Library\Behavior\ ...

  4. 简单通俗讲解DOM

    在开始之前先说一点,DOM是非常容易理解的,但是大家说的太官方,让人很是难于理解,我们就用非常简单的语言翻译一遍.加深对DOM的理解,从而对它有一个全面的认识. 什么是DOM DOM的全称是Docum ...

  5. spring boot 1.5.2 操作mongodb3.4.0

    1:build.gradle 添加mongodb依赖 dependencies { compile('org.springframework.boot:spring-boot-starter-web' ...

  6. STM32F429I-DISCO 和GPS的亲热接触

    第27章 GPS LCD显示教程 本期教程为大家解说GPS Global Positioning System(全球定位系统)的使用,.GPS是由美国国防部研制建立的一种具有全方位.全天候.全时段.高 ...

  7. SSH框架学习

    首先,SSH不是一个框架,而是多个框架(struts+spring+hibernate)的集成,是目前较流行的一种Web应用程序开源集成框架,用于构建灵活.易于扩展的多层Web应用程序. 集成SSH框 ...

  8. memcached 下载安装

    wget http://memcached.org/latest tar -zxvf memcached-1.x.x.tar.gz cd memcached-1.x.x ./configure &am ...

  9. Linux RAID5+备份盘测试

    RAID5磁盘阵列组技术至少需要3块盘来做,加上1块备份盘(这块硬盘设备平时是闲置状态不用工作,一旦RAID磁盘阵列组中有硬盘出现故障后则会马上自动顶替上去),总共是需要向虚拟机中模拟4块硬盘设备. ...

  10. Linux文件大小排序

    ls 文件详情 ls   -S /            ###从大到小排序ls   -Sr /          ###从小到大排就加个-r     -r 翻转ls   -aSr /         ...