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 ...
随机推荐
- 如何通过js关闭微信浏览器页面
WeixinJSBridge.call('closeWindow'); jssdk wx.closeWindow(); WeixinJSBridge对象还提供了哪些功能: WeixinJSBridge ...
- 【Nodejs】理想论坛帖子爬虫1.02
在1.01版本中,我发现各回调函数找到数据后再插入数据库有个竞争问题不好解决,如果等所有回调都完成也没有好的处理方法,因为启动不止一处启动了新的TopicSpider实例. 于是我决定把读数据和写DB ...
- C#.NET常见问题(FAQ)-如何将cs文件编译成dll文件 exe文件 如何调用dll文件
比如我要把TestDLL.cs文件编译成dll文件,则在命令提示符下,输入下面的命令,生成的文件为TestDLL.dll csc /target:library TestDLL.cs 注意前提是你安装 ...
- Office WORD如何在图片上添加文字
如图所示,在图片格式中选择图片衬于文字下方即可,这样看起来感觉就像在图片上直接加字一样,没有生硬的感觉. 最终效果: Word如何在图片上添加文字Word如何在图片上添加文字Word如何在图片上添加文 ...
- ArcGIS中的AddIn开发示例
AddIn开发的插件效率高.操作简单.容易管理.方便共享.它还可以和Python结合(后面的博文中应该会涉及到),非常强大.下面简单描述一下ArcGIS中的AddIn开发过程: 1.在安装ArcGIS ...
- flume hdfs一些简单配置记忆
############################################ # producer config ##################################### ...
- [模式识别].(希腊)西奥多里蒂斯<第四版>笔记5之__特征选取
1,引言 有关模式识别的一个主要问题是维数灾难.我们将在第7章看到维数非常easy变得非常大. 减少维数的必要性有几方面的原因.计算复杂度是一个方面.还有一个有关分类器的泛化性能. 因此,本章的主要任 ...
- UVA 357 Let Me Count The Ways(全然背包)
UVA 357 Let Me Count The Ways(全然背包) http://uva.onlinejudge.org/index.php?option=com_onlinejudge& ...
- Starting MySQL.. ERROR! The server quit without updating PID file (/gechong/mysqldata/10-9-23-119.pid).
配置文件修改错误了,还原一下重启服务就OK了. # /etc/init.d/mysql start
- java 图片数据Base64编解码
import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import ...