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 ...
随机推荐
- Android -- PullToRefresh应用
PullToRefresh 支持ListView.ExpandableListView.GridView.WebView 下载地址:https://github.com/chrisbanes/Andr ...
- Java 调用Web service 加入认证头(soapenv:Header)
前言 有时候调用web service 会出现 Message does not conform to configured policy [ AuthenticationTokenPolicy(S) ...
- 【Window OS】”对于目标文件系统,文件XXXXX过大“导致无法进行文件操作的解决方法
问题原因:这是目标文件系统不支持这么大的文件的操作问题.例如:目标文件系统的格式是FAT32,FAT32最大支持4G,如果你要进行发送或粘贴4G以上的文件就会出现这个问题. 解决办法:把目标文件系统的 ...
- TCP/TP编程 - 一个简单的Linux下C写的socket服务器客户端程序
服务端: hello_server.c #include <stdio.h> #include <stdlib.h> #include <string.h> #in ...
- 如何设置qt creator的快捷键
如何设置qt creator快捷键 以设置设置edit - select encoding的快捷键为例 1. tools - options - environment - keyborad 2.在搜 ...
- 文件的上传Commons FileUpload(web基础学习笔记十六)
一.表单设置 <form action="<%=request.getContextPath()%>/jsp/admin/doAdd.jsp" enctype=& ...
- js 暂时性死区
1.概念 在代码块内,使用let.const命令声明变量之前,该变量都是不可用的.这在语法上,称为“暂时性死区”(temporal dead zone,简称 TDZ). 2.注意 “暂时性死区”也意味 ...
- jquery 清除style样式
$("#show").removeAttr("style"); //ie,ff均支持 $("#show").attr("style ...
- Java的代理模式(通过公共接口实现)
代理模式的一种常见的实现方案是,定义一个接口或抽象类,并派生出目标子类,和代理子类.我们要操作的是目标子类里的方法,而很多时候,我们需要为目录子类中的方法增加额外的处理,如果增加日志功能.条件判断等, ...
- windows installer服务无法启动,无法打开任何msi文件
如果不成功就在"依存关系"中找是否有其他的文件没有启用. 启用"remote procedure call(rpc)" 启用"workstation& ...