我一直在努力寻找 Presto 模式中的表和列,如下面的经典 PL/SQL:“select column_name, table_name from all_tab_columns?” 在急速 doc没有发现任何指向这个的东西。 你可以显示 columns in a table和 tables in a schema但不是所有表在模式中都有各自的列。 一个用例是查找包含所需列名的表,如: “从 all_tab_columns 中选择 column_name、table_name,其中 column_name 类似于‘%something_potentially_useful%’” similar post正在回答如何查看 information_schema 中的所有表和模式,但不幸的是 information_schema 不包含 column_name 作为描述符。
先谢谢你!
最佳答案
information_schema.columns
包含所有可用信息:
SELECT * FROM <catalog>.information_schema.columns
从 Presto 327 开始,information_schema.columns
表具有以下列:
presto:default> DESCRIBE tpch.information_schema.columns;
Column | Type | Extra | Comment
------------------+---------+-------+---------
table_catalog | varchar | |
table_schema | varchar | |
table_name | varchar | |
column_name | varchar | |
ordinal_position | bigint | |
column_default | varchar | |
is_nullable | varchar | |
data_type | varchar | |
comment | varchar | |
extra_info | varchar | |
(10 rows)
关于sql - 有什么方法可以在 Presto 中显示模式中的所有列和表?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59456379/