PL/SQL START WITH & LEVEL & SIBLINGS

select  b.id,
        b.root_id,
        lpad ( ' ', 5 * ((decode(level,1,0,level))) ) || b.name dept_name,
        decode(b.active ,1,'X',' ') active
from schema_name.table_name b
connect by prior b.id=b.root_id
start with b.id=:p_id
order siblings by b.name;

Comments

Popular posts from this blog

Solution for "Can not obtain Oracle client information from registry"

Solution for the fault: "System.Diagnostics.Process.Start is not working on IIS, but working on ASP.NET Development Server"