我有5個表,我想比較DLL日期和Max(ora_rowscn)。SCN_TO_TIMESTAMP(Max(ora_rowscn))爲表列表創建一個新的修改表
select owner, object_name, LAST_DDL_TIME from dba_objects;
select * from dba_objects
where object_name in ('Table_1', 'Table_2', 'Table_3', 'Table_4','Table_5')
我知道我可以用一個「與條款」 &聯盟所有SCN_TO_TIMESTAMP數據加入到DBA_OBJECTS表,但有一個更有效的方式在現實中我有超過5桌。
with
table 1 as (SELECT 'table1' as Table,SCN_TO_TIMESTAMP (Max(ora_rowscn)) from table1),
table 2 as (SELECT 'table2' as Table,SCN_TO_TIMESTAMP (Max(ora_rowscn)) from table2),
table 3 as (SELECT 'table3' as Table,SCN_TO_TIMESTAMP (Max(ora_rowscn)) from table3),
....and so on
有沒有一種方法,我可以用在DBA_OBJECTS查詢使用SCN_TO_TIMESTAMP(MAX(ORA_ROWSCN)),列表中的每個表的名稱創建的列表?