【发布时间】:2011-03-25 08:54:30
【问题描述】:
一个数据库中有太多的表。我怎样才能只显示具有某些模式的表格?或者有没有办法可以在 shell 命令中像“| more”一样进行分页?
【问题讨论】:
-
不是mysql,而是oracle,你可以“select * from cat where table_name like '%xxxx'”。 mysql必须存在相同的功能
标签: mysql pagination show
一个数据库中有太多的表。我怎样才能只显示具有某些模式的表格?或者有没有办法可以在 shell 命令中像“| more”一样进行分页?
【问题讨论】:
标签: mysql pagination show
您不必使用show tables,也可以使用任何过滤器查询information_schema.TABLES。
【讨论】:
show tables like 'pattern';
【讨论】:
show tables like '%pattern%'; 也可以:)
这可以用来一瞥所有的表格
select * from tab;
并识别列名。此后,使用
select * from tab where tname like '%D_';
【讨论】:
例如:
show tables like 'test%' 将过滤诸如“test1,testF,test111,testFoo”之类的表
show tables like 'test_' 将过滤诸如“test1,testF”之类的表
【讨论】:
在 Spark SQL 中,您需要使用星号,SHOW tables LIKE '*table_name*
【讨论】: