Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> comp.databases.theory -> Re: Nested set model with large gaps and spreads in the numbering

Re: Nested set model with large gaps and spreads in the numbering

From: --CELKO-- <71062.1056_at_compuserve.com>
Date: 20 Sep 2002 08:20:00 -0700
Message-ID: <c0d87ec0.0209200720.5fa5d453@posting.google.com>


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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US