MySQL中 如何查询表名中包含某字段的表 ,查询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'
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数据库架构信息:数据库,表,表字段的更多相关文章
- MySQL中 如何查询表名中包含某字段的表
查询tablename 数据库中 以"_copy" 结尾的表 select table_name from information_schema.tables where tabl ...
- Oracle中把一张表查询结果插入到另一张表中
1. 新增一个表,通过另一个表的结构和数据 create table XTHAME.tab1 as select * from DSKNOW.COMBDVERSION 2. 如果表存在: inse ...
- mysql结构相同的三张表查询一条记录\将一张表中的数据插入另外一张表
将一张表中的数据插入另外一张表 1.两张表结构相同 insert into 表1名称 select * from 表2名称 2.两张结构不相同的表 insert into 表1名称(列名1,列名2,列 ...
- mysql数据库补充知识3 查询数据库记录信息之多表查询
一 介绍 准备表 company.employeecompany.department 复制代码 #建表 create table department( id int, name varchar(2 ...
- mysql数据库补充知识2 查询数据库记录信息之单表查询
一 单表查询的语法 SELECT 字段1,字段2... FROM 表名 WHERE 条件 GROUP BY field HAVING 筛选 ORDER BY field LIMIT 限制条数 二 关键 ...
- 三十二. 多表查询 MySQL管理工具 、 用户授权及撤销
1.MySQL管理工具 部署LAMP+phpMyAdmin平台 安装httpd.mysql.php-mysql及相关包 启动httpd服务程序 解压phpMyAdmin包,部署到网站目录 配置conf ...
- Linux记录-shell获取hdfs表查询mysql
#!/bin/sh hdfs dfs -ls /user/hive/warehouse | awk '{print $8}' | awk -F "/" '{print $5}' & ...
- 查询MySql数据库架构信息:数据库,表,表字段
/*1.查询所有数据库*/ show databases; /*2.查询所有数据表*/ select * from information_schema.tables where table_sch ...
- mysql,SQL标准,多表查询中内连接,外连接,自然连接等详解之查询结果集的笛卡尔积的演化
先附上数据. CREATE TABLE `course` ( `cno` ) NOT NULL, `cname` ) CHARACTER SET utf8 NOT NULL, `ctime` ) NO ...
随机推荐
- Sqlserver存储过程生成日期维度
话不多说,之前已经有一篇日志是利用oracle的存储过程生成日期维度表,接下来我们就用sqlserver来实现这个操作,如下面的步骤所示 1:创建日期维度表(Dim_time) USE [DW] GO ...
- PHP高级教程-多维数组
PHP 多维数组 一个数组中的值可以是另一个数组,另一个数组的值也可以是一个数组.依照这种方式,我们可以创建二维或者三维数组: 实例 <?php // 二维数组: $cars = array ( ...
- PHP表单- PHP $_GET 变量
PHP $_GET 变量 在 PHP 中,预定义的 $_GET 变量用于收集来自 method="get" 的表单中的值. $_GET 变量 预定义的 $_GET 变量用于收集来自 ...
- SQL之查询函数LOCATE、POSITION、INSTR、FIND_IN_SET、IN、LIKE
- 采集的时候,列表的编码是gb2312,内容页的编码却是UTF-8,这种网站怎么采集?
采集的时候,列表的编码是gb2312,内容页的编码却是UTF-8,这种网站怎么采集? 采集的时候,列表的编码是UTF-8,内容页的编码却是gb2312,这种网站怎么采集? 这种情况怎么解决呢? 哈哈哈 ...
- webpack 编译ES6插件babel-loader
1.安装babel-loader 参考:http://babeljs.io/docs/setup/#installation 进入项目目录执行安装命名: npm install --save-dev ...
- ConcurrentHashMap并不是绝对线程安全的
import java.util.HashMap; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; publi ...
- exception ORA-00923: FROM keyword not found where expected
exception ORA-00923: FROM keyword not found where expected CreationTime--2018年8月16日10点41分 Author:M ...
- oracle 建表时显示ORA-00984: 列在此处不允许
oracle 建表时显示ORA-00984: 列在此处不允许 CreationTime--2018年7月19日16点10分 Author:Marydon 1.情景展示 使用plsql建表时,报错 ...
- 新浪微博api出现认证失败问题 (获取code字段值的问题)
出现该提示的原因:`` - 说: (2015-10-30 18:06:14)回调地址不一致,`` - 说: (2015-10-30 18:07:38)请在编辑开发者信息中将网站地址和应用信息--高级信 ...