3,494
社区成员




create or replace function functest1(str in varchar2)return number
as
num number;
begin
execute immediate 'select '||replace(substr(str,2),',','*')||' from dual' into num;
return num;
exception
when others then
return -1;
end;
select * from
(select max(parent)keep(dense_rank last order by level)parent,
max(child)keep(dense_rank last order by level)child,
max(child_type)keep(dense_rank last order by level)child_type ,
functest1(max(sys_connect_by_path(quantity,','))keep(dense_rank last order by level))count
from table1
start with parent='p1'
connect by prior child=parent
and prior child_type='special'
group by rownum-level)
where child_type <>'special';