Oracle树结构查询按层级排序
程序员文章站
2022-10-16 12:22:42
SQL代码: SELECT t.* FROM pt_org_info t START WITH t.id = 1 CONNECT BY t.par_id = PRIOR t.id ORDER SIBLINGS BY t.id; 效果图: ......
sql代码:
select t.* from pt_org_info t start with t.id = 1 connect by t.par_id = prior t.id order siblings by t.id;
效果图: