-3

I want a query that returns me name of columns of a table.

I tried following query -

SELECT column_name ColName 
  FROM all_tab_columns 
 WHERE table_name ='<TABLENAME>';

but this query is returning duplicate column names.

I do not want to use distinct in my query cause it hampers the performance.

So is there a query which returns columns of a table without any duplicate.

Ollie
  • 17,058
  • 7
  • 48
  • 59
user1049021
  • 257
  • 1
  • 9
  • 22

1 Answers1

-1

This is the solution for getting column name from table.

    select column_name,data_type from cols where Table_name='TEST_TABLE'
Sathyajith Bhat
  • 21,321
  • 22
  • 95
  • 134
Vishal Ranapariya
  • 1,026
  • 8
  • 8