当前位置: 动力学知识库 > 问答 > 编程问答 >

oracle - SQL query for finding tables containing a column in my schema

问题描述:

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;
分享给朋友:
您可能感兴趣的文章:
随机阅读: