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

posted @ 2018-04-03 10:25  钱若梨花落  阅读(2328)  评论(0编辑  收藏  举报