【问题标题】:How to list the columns of a table in Teradata SQL如何在 Teradata SQL 中列出表的列
【发布时间】:2018-02-27 16:45:53
【问题描述】:

我一直在谷歌搜索这个网站,但找不到这个简单问题的答案。

如何在 Teradata 中列出或选择表的所有列?

【问题讨论】:

  • select ColumnName from dbc.columns where DatabaseName = <'DB_NAME'> and TableName = <'table_name'>;

标签: sql teradata


【解决方案1】:

不同的可能性

Help table <TableName> -- All columns of a table 
Help columns  <ViewName>.* -- All columns of a View
Show table <TableName> -- DDL of table
Show view <ViewName> -- DDL of View
show select * from  <ViewName>-- DDL of base table in a view

或从系统表中选择。

SELECT ColumnName 
FROM dbc.columnsV
WHERE DatabaseName = 'DB_NAME' and
TableName = 'table_name';

搜索teradata column name list 可以获得更多答案。

【讨论】:

    猜你喜欢
    • 2023-01-18
    • 2023-01-18
    • 2020-11-04
    • 2017-07-19
    • 2020-08-31
    • 2020-12-27
    • 2021-08-30
    • 2019-08-10
    • 2018-08-05
    相关资源
    最近更新 更多