3,494
社区成员




select ids, substr(path, 2, instr(path, '/', 2) - 2) PARENT_IDs
from (select c.ids, sys_connect_by_path(c.PARENT_IDs, '/') || '/' path
from test1 c
CONNECT BY PRIOR c.ids = c.PARENT_IDs
start with c.PARENT_IDs in
(select ids from test1 where PARENT_IDS = 0))