Re: Celko: short book on the nested sets model for trees.
Date: 3 May 2002 06:13:54 GMT
Message-ID: <3cd22aa2$1_at_usenetgateway.com>
--Celko-- wrote:
> I am writing a short book on the nested sets model for trees.
> If anyone has some programming tips, tricks, assorted code or whatever
> 4) Multiple tree structures on the same set of nodes
I stumbled onto your nested set articles and I want to first thank you. The nested set has made dealing with our complicated hierarchies much easier for me here at work. Anyway-- We have to deal with the same nodes as part of multiple trees. I solved the problem by creating a Hierarchy table and linking that with the nested set table. Of course that led to a separate node list table, but that was easy enough.
NS table (NodeID, HierarchyID, leftside, rightside) Node table (NodeID, NodeName, Description, .... <other detail fields>) Hierarchy table(HierarchyID, Description)
I'm having a problem with coming up with query that results in only the immediate children of a given node. Could you offer some insight?
-- Posted via dBforums http://dbforums.comReceived on Fri May 03 2002 - 08:13:54 CEST