Withdata Software

Producing high-quality database tools

Main menu

Skip to primary content
Skip to secondary content
  • Withdata Software
  • Blog
  • Categories
  • Tags

Tag Archives: get index columns

How to get index column names of a table from Oracle

Posted on October 24, 2016 by Shiji Pan

SELECT i.index_name,c.column_name FROM user_ind_columns c, user_indexes i where c.index_name=i.index_name and c.table_name=i.table_name and i.TABLE_NAME='my_table_name' and i.TABLE_OWNER='my_schema_name' See also: How to get index column names of a table from DB2 How to get index column names of ... Read more

Posted in Oracle | Tagged get index columns, Oracle

How to get index column names of a table from SQLite

Posted on October 24, 2016 by Shiji Pan

select sql from sqlite_master where tbl_name='my_table_name' and type='index' you can find the index name and column names in ‘sql’ field. See also: How to get index column names of a table from DB2 How to get index column names of a table from SQL Server How to get index column names ... Read more

Posted in Sqlite | Tagged get index columns, Sqlite

How to get index column names of a table from PostgreSQL

Posted on October 24, 2016 by Shiji Pan

select i.relname as index_name, a.attname as column_name from pg_class t, pg_class i, pg_index ix, pg_attribute a, pg_namespace n where t.oid = ix.indrelid and i.oid = ix.indexrelid and a.attrelid = t.oid and a.attnum = ANY(ix.indkey) and n.oid=t.relnamespace and t.relkind = 'r' and ... Read more

Posted in PostgreSQL | Tagged get index columns, PostgreSQL

How to get index column names of a table from MySQL

Posted on October 24, 2016 by Shiji Pan

SELECT INDEX_NAME,COLUMN_NAME FROM INFORMATION_SCHEMA.STATISTICS WHERE TABLE_SCHEMA = 'my_schema_name' AND TABLE_NAME = 'my_table_name' See also: How to get index column names of a table from DB2 How to get index column names of a table from SQL Server How to get index column names of a table ... Read more

Posted in Mysql | Tagged get index columns, Mysql

How to get index column names of a table from SQL Server

Posted on October 24, 2016 by Shiji Pan

select i.name as IndexName, co.[name] as ColumnName from sys.indexes i join sys.objects o on i.object_id = o.object_id join sys.schemas s on s.schema_id = o.schema_id join sys.index_columns ic on ic.object_id = i.object_id and ic.index_id = i.index_id join sys.columns co on co.object_id = ... Read more

Posted in Sql Server | Tagged get index columns, Sql Server

How to get index column names of a table from DB2

Posted on October 24, 2016 by Shiji Pan

select name,colnames from sysibm.sysindexes where tbname='my_table_name' See also: How to get index column names of a table from SQL Server How to get index column names of a table from MySQL How to get index column names of a table from PostgreSQL How to get index column names of a table from ... Read more

Posted in DB2 | Tagged DB2, get index columns

Recent Posts

  • Use Cases for Dumping to CSV
  • Convert Text to Speech by CSV / TSV
Withdata Software. ©2004 - 2025 All rights reserved.