Re: Nested sort, trying again
From: -CELKO- <jcelko212_at_earthlink.net>
Date: 8 Oct 2005 16:02:51 -0700
Message-ID: <1128812571.048600.211820_at_z14g2000cwz.googlegroups.com>
Date: 8 Oct 2005 16:02:51 -0700
Message-ID: <1128812571.048600.211820_at_z14g2000cwz.googlegroups.com>
>> but I believe that the *direct* children of a given node can be found with the following query: <<
To convert a nested sets model into an adjacency list model:
SELECT B.emp AS boss, E.emp
FROM OrgChart AS E
LEFT OUTER JOIN OrgChart AS B ON B.lft = (SELECT MAX(lft) FROM OrgChart AS S WHERE E.lft > S.lft AND E.lft < S.rgt);Received on Sun Oct 09 2005 - 01:02:51 CEST