Say, we have a column_name and we want to find out which table it belongs to, or to know all the tables and views have this column. Here is my way
SELECT * FROM ALL_TAB_COLUMNS
WHERE COLUMN_NAME = 'ID'
OR
SELECT * FROM ALL_TAB_COLUMNS
WHERE COLUMN_NAME LIKE '%ID%'
Always use upper case for column_name value. It will list all the tables info along with the owner schema.
SELECT * FROM ALL_TAB_COLUMNS
WHERE COLUMN_NAME = 'ID'
OR
SELECT * FROM ALL_TAB_COLUMNS
WHERE COLUMN_NAME LIKE '%ID%'
Always use upper case for column_name value. It will list all the tables info along with the owner schema.
No comments:
Post a Comment