oracle 查询分区表的最大分区以及分区字段的最大值

select 'select max(' || column_name || ') from ' || owner || '.' || name || ';'
  from DBA_PART_KEY_COLUMNS
 where name in (select distinct table_name
                  from dba_tab_partitions
                 where tablespace_name not in ('SYSAUX', 'SYSTEM'))
 order by name

原文地址:https://www.cnblogs.com/ss-33/p/8706826.html