【问题标题】:with presto how to show tables like XXX用presto如何显示像XXX这样的表格
【发布时间】:2018-12-01 16:38:13
【问题描述】:

我在架构s 中有表zzzbbbshow tables from s; 有效。 但是如果模式s 中有很多表,则需要时间来找到正确的表。

docspattern可以帮忙,但是具体怎么用呢?

谢谢。

【问题讨论】:

    标签: mysql sql presto


    【解决方案1】:

    SHOW TABLES LIKE pattern 的行为类似于典型的 SQL LIKE 运算符:

    % - 百分号表示零个、一个或多个字符

    _ - 下划线代表单个字符

    https://www.w3schools.com/sql/sql_like.asp

    presto:tiny> show tables like 'n_tion';
     Table
    --------
     nation
    (1 row)
    
    presto:tiny> show tables like 'n%';
     Table
    --------
     nation
    (1 row)
    

    【讨论】:

    • 值得一提的是,在某些数据库(例如 Hive)中,SHOW TABLE LIKE <pattern> not 的行为类似于 SQL 的 LIKE
    【解决方案2】:

    对于那些与 Athena 合作并最终来到这里的人,请参阅https://docs.aws.amazon.com/athena/latest/ug/show-tables.html

    它使用* 而不是%

    例如 - SHOW TABLES IN sampledb '*flights*'

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2020-12-16
      • 2013-05-20
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-11-08
      • 2021-11-22
      相关资源
      最近更新 更多