我的桌子为
我想创建SQl或过程来获取以下值
FolderPath LeafFolderID
Dept/CSE/Cfolder 100
Dept/Mech 10
Team/HR 22
Settlement 3
请让我知道如何实现这一目标?
答案 0 :(得分:1)
此connect by
完成了任务:
select folderid, ltrim(sys_connect_by_path(foldername, '/'), '/') path
from t
where connect_by_isleaf = 1
connect by folderparentid = to_char(prior folderid)
start with folderparentid = 'Root'