I have found the list of all tables using this query –
x
SELECT DISTINCT OBJECT_NAME
FROM USER_OBJECTS
WHERE OBJECT_TYPE = 'TABLE'
But I need to list all the tables having column name starttime_date
or starttime
.
Advertisement
Answer
You could use USER_TAB_COLS
view.
For example,
SQL> select table_name, column_name, data_type from user_tab_cols where column_name ='DEPTNO';
TABLE_NAME COLUMN_NAM DATA_TYPE
---------- ---------- ----------
DEPT DEPTNO NUMBER
EMP DEPTNO NUMBER
SQL>
You could try,
select *
from user_tab_cols
where column_name in ('STARTTIME_DATE', 'STARTTIME');