Reputation: 215
Can anybody tell me SQL query to return all the tables in my schema which have the column name "IS_REVIEW_APPEALS" ?
I am using Oracle database.
Thanks a lot,
Bhushan
Upvotes: 4
Views: 23556
Reputation: 791
See below query for how to get all columns with the 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;
Upvotes: 3
Reputation: 231661
SELECT table_name
FROM user_tab_cols
WHERE column_name = 'IS_REVIEW_APPEALS'
Upvotes: 11