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
Tag Archives: get index columns
How to get index column names of a table from SQLite
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
How to get index column names of a table from PostgreSQL
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
How to get index column names of a table from MySQL
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
How to get index column names of a table from SQL Server
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
How to get index column names of a table from DB2
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