0

Possible Duplicate:
Oracle column query or search

I need a query which will bring name of the tables that contains that column name in oracle.

Example: Lets say that I have table1 with columns (a,b), table2 with columns (b,c) and table3 with columns (a,b,c,d) so I need a know which tables contain C column so I need a query which will bring table names, how I can do that ?

Thanks

Community
  • 1
  • 1
Shahriar
  • 25
  • 3
  • 11

1 Answers1

3

Try to select from all_tab_columns:

select table_name
from all_tab_columns 
where column_name = 'C' 
and table_name in ('table1','table2','table3') -- optional
and OWNER = 'owner'; -- optional
Robert
  • 25,425
  • 8
  • 67
  • 81