IWETHEY v. 0.3.0 | TODO
1,095 registered users | 0 active users | 0 LpH | Statistics
Login | Create New User
IWETHEY Banner

Welcome to IWETHEY!

New wiki links
For nodes being in the same table, the simplest approach is to have a ParentID that references the parent node's key. Compound keys require more "toParent" columns, but think about using a generated key instead perhaps. Use zero or null for the top-most. That is all that is needed to encode a tree, but there are others ways some claim are faster. Anyhow, here are some wiki topics:

[link|http://www.c2.com/cgi/wiki?TreeInSql|http://www.c2.com/cgi/wiki?TreeInSql]

[link|http://www.c2.com/cgi/wiki?RelationalAndTrees|http://www.c2.com/cg...elationalAndTrees]
________________
oop.ismad.com
Collapse Edited by tablizer June 3, 2004, 11:57:01 PM EDT
wiki links
For nodes being in the same table, the simplest approach is to have a ParentID. That is all that is needed to encode a tree. Anyhow, here are some wiki topics:

[link|http://www.c2.com/cgi/wiki?TreeInSql|http://www.c2.com/cgi/wiki?TreeInSql]

[link|http://www.c2.com/cgi/wiki?RelationalAndTrees|http://www.c2.com/cg...elationalAndTrees]

________________
oop.ismad.com
     How to store a tree structure in a relational db? - (bluke) - (20)
         Ask Bryce! - (folkert) - (1)
             wiki links - (tablizer)
         Which database engine? - (admin) - (2)
             Re: Which database engine? - (bluke) - (1)
                 CONNECT BY is out then. :-) - (admin)
         why not store it in a document - (boxley) - (1)
             We want to move away from LDAP ... - (bluke)
         Just use Windows Server 2003 and Active Directory! - (pwhysall) - (1)
             **thwak!** -NT - (jb4)
         See what Scott said - (ben_tilly) - (2)
             Before 9i - (admin) - (1)
                 I don't use it, so I wouldn't know. Correction appreciated. -NT - (ben_tilly)
         Re: How to store a tree structure in a relational db? - (johnu) - (7)
             AKA Nested Set Trees. :-) -NT - (admin) - (6)
                 After reading about nested sets ... - (bluke) - (5)
                     Updates aren't an issue. - (admin) - (3)
                         If I had to do it over.... - (ChrisR) - (2)
                             That's exactly how I do it. - (admin) - (1)
                                 Guess I'll have to try it for myself - (ChrisR)
                     We have a lot of inserts - (bluke)

Wow. I am just. Wow. Un-. Wow. You'd think...Nah. Wow.
72 ms