select *
from (select distinct t.cid id,
t.pid pid,
t.corder,
t.code_name name,
LEVEL lv,
connect_by_isleaf isleaf,
t.code_enabled,
ltrim(sys_connect_by_path(CODE_NAME, '.'), '.') paths,
decode(Level,
5,
decode(t.code_enabled,
1,
decode(connect_by_isleaf, 1, 'icon-ok'))) iconcls
from c_code_bxxmlx t
where t.code_year = '2018'
start with t.pid = 'root'
connect by prior t.cid = t.pid) tb
order by tb.corderOracle树形查询,路径,有条件判断
最新推荐文章于 2024-07-16 09:41:27 发布
本文介绍了一种使用PL/SQL进行复杂层级查询的方法,通过具体代码示例展示了如何利用CONNECT BY和START WITH子句来获取分层数据,并对结果进行图标标记。
1983

被折叠的 条评论
为什么被折叠?



