在项目中,我通过迭代算法实现树结构查询
select id,ParentID,url,name,level cc from table connect by prior id=ParentID start with ParentID=0
项目中要求,查出的记录按sort字段排序
select id,ParentID,url,name,level cc from (select * from table order by sort) connect by prior id=ParentID start with ParentID=0
但这样查出的结果集,没有实现排序
请指教,急需 急需 急需 急需 急需
select id,ParentID,url,name,level cc from table connect by prior id=ParentID start with ParentID=0
项目中要求,查出的记录按sort字段排序
select id,ParentID,url,name,level cc from (select * from table order by sort) connect by prior id=ParentID start with ParentID=0
但这样查出的结果集,没有实现排序
请指教,急需 急需 急需 急需 急需
select id,ParentID,url,name,level cc from table
connect by prior id=ParentID start with ParentID=0
order by sort
select id,ParentID,url,name,level cc, sort from table start with ParentID=0
connect by prior id=ParentID)
order by sort