| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> comp.databases.theory -> Re: Nested set model with large gaps and spreads in the numbering
You put in a lot of work on this one! I also like the idea of giving
the gaps names. One trick that might help is that the immediate
subordinates (the children) can be found with this query:
SELECT B.emp AS boss, P.emp
FROM OrgChart AS P
LEFT OUTER JOIN
OrgChart AS B
ON B.lft
= (SELECT MAX(lft)
FROM OrgChart AS S
WHERE P.lft > S.lft
AND P.lft < S.rgt);
Received on Fri Sep 20 2002 - 10:20:00 CDT
![]() |
![]() |