给MySQL的show table status结果做过滤

栏目: 数据库 · 发布时间: 6年前

内容简介:MySQL中可以使用 show table status 查看表的状态,但是不能像select 语句选出结果那样做结果过滤。有没有办法像select语句那样过滤呢,答案是有的,就是从information_schema库的tables表中查询。如下是模仿show table status 的SQL:

MySQL中可以使用 show table status 查看表的状态,但是不能像select 语句选出结果那样做结果过滤。

有没有办法像select语句那样过滤呢,答案是有的,就是从information_schema库的tables表中查询。

如下是模仿show table status 的SQL:

SELECT table_name,Engine,Version,Row_format,table_rows,Avg_row_length,
  Data_length,Max_data_length,Index_length,Data_free,Auto_increment,
  Create_time,Update_time,Check_time,table_collation,Checksum,
  Create_options,table_comment
FROM information_schema.tables
WHERE Table_Schema='MyDataBaseName';

注意替换MyDataBaseName的名称为自己的库名称,这样就可以方便在Where部分添加各种条件过滤了。


以上就是本文的全部内容,希望本文的内容对大家的学习或者工作能带来一定的帮助,也希望大家多多支持 码农网

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

The Practice of Programming

The Practice of Programming

Brian W. Kernighan、Rob Pike / Addison-Wesley / 1999-2-14 / USD 49.99

With the same insight and authority that made their book The Unix Programming Environment a classic, Brian Kernighan and Rob Pike have written The Practice of Programming to help make individual progr......一起来看看 《The Practice of Programming》 这本书的介绍吧!

CSS 压缩/解压工具
CSS 压缩/解压工具

在线压缩/解压 CSS 代码

Base64 编码/解码
Base64 编码/解码

Base64 编码/解码

RGB CMYK 转换工具
RGB CMYK 转换工具

RGB CMYK 互转工具