如何用SQL查询语句获取Oracle表 树形结构的记录(PL/SQL )

来源:互联网 发布:淘宝宝贝修改价格影响 编辑:程序博客网 时间:2024/05/06 09:48

 

例子:

select  /*+choose */  topic_id, lpad(' ',level*5,' ') || label, hotkeys
from
(select topic_id, hotkeys, label,parentid from ipop_topic where application_id=1008 and active=1 order by label) connect by parentid = prior topic_id
start with parentid = 0

原创粉丝点击