Re: Information retrieval in parent-child hierachy
From: konghou <brotherhou_at_yahoo.com>
Date: 9 Jun 2002 20:07:11 -0700
Message-ID: <c19678a1.0206091907.5693ab1e_at_posting.google.com>
Date: 9 Jun 2002 20:07:11 -0700
Message-ID: <c19678a1.0206091907.5693ab1e_at_posting.google.com>
For a max. of 3 levels this query will work:
select empno parent, empno child from emp --base level
union all
select mgr, empno from emp --upper level
union all
select b.mgr, a.empno from emp a, emp b --second upper level
where a.mgr=b.empno
/
For known number of levels, more upper levels can be union with this query. Received on Mon Jun 10 2002 - 05:07:11 CEST