如何在Netezza中列出所有列名?

时间:2022-09-23 21:36:32

Is there a query I can write to search all the column names for a particular database in Netezza?

我可以编写一个查询来搜索Netezza中特定数据库的所有列名吗?

3 个解决方案

#1


7  

Within the same database you can use the following query:

在同一个数据库中,您可以使用以下查询:

select *
from _v_odbc_columns1
where column_name like '%columnname%'

or a less Netezza specific query

或者更少的Netezza特定查询

select *
from information_schema.columns
where column_name like '%columnname%'

#2


3  

You would access something similar to an information_schema. Column Name, %COW%', would use % as a wildcard...gathering any column that has 'COW' in the name

您将访问类似于information_schema的内容。列名称%COW%'将使用%作为通配符...收集名称中包含“COW”的任何列

SELECT * 
FROM _V_SYS_COLUMNS 
WHERE 
COLUMN_NAME like '%COW%' 
AND TABLE_SCHEMA = 'DEV' 
ORDER BY TABLE_NAME 
;

#3


2  

The important catalog views in netezza system are listed below

netezza系统中的重要目录视图如下所示

  • _V_USER: the user view gives information about the users in the netezza system.
  • _V_USER:用户视图提供有关netezza系统中用户的信息。

  • _V_TABLE: the table view contains the list of tables created in the netezza performance system.
  • _V_TABLE:表视图包含在netezza性能系统中创建的表的列表。

  • _V_RELATION_COLUMN: the relation column system catalog view contains the columns available in a table.
  • _V_RELATION_COLUMN:关系列系统目录视图包含表中可用的列。

  • _V_TABLE_INDEX: this system catalog contains the information about the indexes created on table. netezza does not support creating indexes on a table as of now.
  • _V_TABLE_INDEX:此系统目录包含有关在表上创建的索引的信息。到目前为止,netezza不支持在表上创建索引。

  • _V_OBJECTS: lists the different objects like tables, view, functions etc. available in the netezza.
  • _V_OBJECTS:列出netezza中可用的不同对象,如表,视图,函数等。

Example:

SELECT * 
FROM _V_RELATION_COLUMN
WHERE
    ATTNAME like '%GEO%' --SPECIFY COLUMN NAME
    AND type = 'TABLE'

#1


7  

Within the same database you can use the following query:

在同一个数据库中,您可以使用以下查询:

select *
from _v_odbc_columns1
where column_name like '%columnname%'

or a less Netezza specific query

或者更少的Netezza特定查询

select *
from information_schema.columns
where column_name like '%columnname%'

#2


3  

You would access something similar to an information_schema. Column Name, %COW%', would use % as a wildcard...gathering any column that has 'COW' in the name

您将访问类似于information_schema的内容。列名称%COW%'将使用%作为通配符...收集名称中包含“COW”的任何列

SELECT * 
FROM _V_SYS_COLUMNS 
WHERE 
COLUMN_NAME like '%COW%' 
AND TABLE_SCHEMA = 'DEV' 
ORDER BY TABLE_NAME 
;

#3


2  

The important catalog views in netezza system are listed below

netezza系统中的重要目录视图如下所示

  • _V_USER: the user view gives information about the users in the netezza system.
  • _V_USER:用户视图提供有关netezza系统中用户的信息。

  • _V_TABLE: the table view contains the list of tables created in the netezza performance system.
  • _V_TABLE:表视图包含在netezza性能系统中创建的表的列表。

  • _V_RELATION_COLUMN: the relation column system catalog view contains the columns available in a table.
  • _V_RELATION_COLUMN:关系列系统目录视图包含表中可用的列。

  • _V_TABLE_INDEX: this system catalog contains the information about the indexes created on table. netezza does not support creating indexes on a table as of now.
  • _V_TABLE_INDEX:此系统目录包含有关在表上创建的索引的信息。到目前为止,netezza不支持在表上创建索引。

  • _V_OBJECTS: lists the different objects like tables, view, functions etc. available in the netezza.
  • _V_OBJECTS:列出netezza中可用的不同对象,如表,视图,函数等。

Example:

SELECT * 
FROM _V_RELATION_COLUMN
WHERE
    ATTNAME like '%GEO%' --SPECIFY COLUMN NAME
    AND type = 'TABLE'