SQL query to search for tables containing a column in my schema

Can someone tell me an SQL query to return all the tables in my schema that have the column name "IS_REVIEW_APPEALS"?

I am using an Oracle database.

Thank you very much,

Bhushan

+4
source share
2 answers
SELECT table_name FROM user_tab_cols WHERE column_name = 'IS_REVIEW_APPEALS' 
+11
source

See below for a query on how to get all columns with a given name for a specific schema in Oracle:

 SELECT t.owner AS schema_name, t.table_name, c.column_name FROM sys.all_tables t INNER JOIN sys.all_tab_columns c ON t.table_name = c.table_name WHERE LOWER(t.owner) = LOWER('MySchemaNameHere') AND LOWER(c.column_name) LIKE LOWER('%MyColumnNameHere%') ORDER BY t.owner, t.table_name, c.column_name; 
+2
source

Source: https://habr.com/ru/post/1379822/


All Articles