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.corder
Oracle树形查询,路径,有条件判断
最新推荐文章于 2022-07-25 18:18:46 发布