如果您不想编写任何 PL/SQL,请尝试使用(一般情况下):
select
sys.dbms_metadata_util.long2varchar(4000, 'TABLE_NAME', 'COLUMN_NAME', tp.rowid) as COLUMN_NAME
from
TABLE_NAME tp
where
<your_condition on table TABLE_NAME>
不要在表 TABLE_NAME 的 ...your_condition 中使用 COLUMN_NAME ...
在您的情况下,它有点复杂,因为您查询了一个 VIEW。有必要挖掘视图代码并将查询重写为:
select PARTITION_NAME, HIGH_VALUE from (
select t.PARTITION_NAME, sys.dbms_metadata_util.long2varchar(4000, 'SYS.TABCOMPART$', 'HIBOUNDVAL', tp.rowid) as high_value
from
all_tab_partitions t, sys.obj$ o, sys.tabcompart$ tp
where
t.table_name = 'TABLE_NAME'
and t.table_owner = 'SCHEMA_NAM'
and o.name = t.table_name
and o.subname = t.partition_name
and o.obj# = tp.obj#(+)
)
where
high_value > to_number(TO_CHAR(TRUNC(ADD_MONTHS(SYSDATE, 1), 'MONTH'), 'YYYYDDD'))
在 Oracle 11g 上测试