【发布时间】:2018-02-27 16:45:53
【问题描述】:
我一直在谷歌搜索这个网站,但找不到这个简单问题的答案。
如何在 Teradata 中列出或选择表的所有列?
【问题讨论】:
-
select ColumnName from dbc.columns where DatabaseName = <'DB_NAME'> and TableName = <'table_name'>;
我一直在谷歌搜索这个网站,但找不到这个简单问题的答案。
如何在 Teradata 中列出或选择表的所有列?
【问题讨论】:
select ColumnName from dbc.columns where DatabaseName = <'DB_NAME'> and TableName = <'table_name'>;
不同的可能性
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 可以获得更多答案。
【讨论】: