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 ...
随机推荐
- OpenNMS编译,打包并在Windows下启动
1.Download Opennms latest source code 2.Download latest Java JDK and install it. Set JAVA_HOME path ...
- Visio 2013 由于形状保护、容器和/或图层属性的设置,无法完全执行此命令
形状的保护 解决问题:Visio 2013 由于形状保护.容器和/或图层属性的设置,无法完全执行此命令 重要: 本文是由机器翻译的,请参阅免责声明.请在 此处 中查找本文的英文版本以便参考. 禁止对形 ...
- [LeetCode-20]Construct Binary Tree from Inorder and Postorder Traversal
Given inorder and postorder traversal of a tree, construct the binary tree. Note: You may assume tha ...
- 【Nodejs】“快算24”扑克牌游戏算法 1.02
快算24是一种挺好的锻炼孩子算数能力的扑克牌游戏,它的游戏方式是把四张牌的牌面数值通过有限四则运算得到结果24,四张牌必须仅用一次.各地玩法还有点差别,有的只算1-10,其它抽出来:有的地方把整幅牌都 ...
- 在Ubuntu 桌面版 12.04 LTS安装并运行SSH
第一步:安装openssh-server #sudo apt-get install openssh-server 第二步:查看ssh服务是否已经运行,执行 #ps -e | grep ssh 执行完 ...
- JS 提交form表单
源码实例一:javascript 页面加裁时自动提交表单Form表单:<form method="post" id="myform" action=&qu ...
- Java从零开始学二十四(集合工具类Collections)
一.Collections简介 在集合的应用开发中,集合的若干接口和若干个子类是最最常使用的,但是在JDK中提供了一种集合操作的工具类 —— Collections,可以直接通过此类方便的操作集合 二 ...
- Showing a tooltip
We can provide a balloon help for any of our widgets. #!/usr/bin/python # -*- coding: utf-8 -*- &quo ...
- windows2003密码忘记了该如何处理
如果你有sql server的管理员帐号,并且可以登录,尝试用下面的方法: --用管理员连接sql,在查询分析器中执行: --添加用户 exec mas ...
- MikroTik RB750r2/RB750gr3 操作记录
1. 客户端的下载 http://www.mikrotik.com/download 下载 winbox 2. Reset重置密码的正确姿势 http://wiki.mikrotik.com/ind ...