Oracle SQL: How do I find the table name given the column names? Oracle SQL: How do I find the table name given the column names? sql sql

Oracle SQL: How do I find the table name given the column names?


Based on @Roobie's solution, the code below searches in all schemas you have access to, in case the table is not in your own schema. Also added case-insensitive matching.

SELECT owner, table_name  FROM all_tab_columns  WHERE UPPER(column_name) = UPPER('MYCOL');


Try this (one known column):

CREATE TABLE mytab(mycol VARCHAR2(30 CHAR));

SELECT table_name FROM user_tab_columns WHERE column_name='MYCOL';

Note MYCOL is in upper case in column_name='MYCOL';

Cheers!


select * from all_updatable_columns where column_name like 'reqd col name';