问题描述:

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

网友答案:
SELECT table_name
  FROM user_tab_cols
 WHERE column_name = 'IS_REVIEW_APPEALS'
网友答案:

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;
相关阅读:
Top