select max(str) str
from (
select ncol, wm_concat(PT_NAME) over ( partition by ncol order by lv) str
from (
select 1 ncol, t.PT_NAME, o.lv
from table_VB_T t,
(select abc, lv
from (
select regexp_substr(
(select zg_id from table_A_T where HT_ID = '28282'),
'[^/]+', 1, level) abc,
level lv
from dual
connect by regexp_substr(
(select zg_id from table_A_T where HT_ID = '28282'),
'[^/]+', 1, LEVEL) is not null
)) o
where t.PT_ID = o.abc
order by o.lv) a)
group by ncol;