Re: Tree (forest) design
Date: 5 Mar 2004 13:41:23 -0800
Message-ID: <4b45d3ad.0403051341.73fd1e9f_at_posting.google.com>
> > Can you prove that your steps actually work by producing a "Nearest > > Common Ancestor Report" equivalent to that shown at > > www.xdb1.com/Example/Ex076.asp starting from the same normalized, > > null-less data? > > Let me steal code from one of my books, the parts explosion of a > Frammis ina nested sets model:
Below is one way to represent Ex076's data in RDM. Note, each thing in the hierarchy can be of different type. Each thing in the hierarchy can have multiple parents. Each thing is nomalized. Solution is NULL-less (for the limited data shown below). The solutions you and Mikito provided don't work with this level of generalization.
T_Hierarchy
ParTblID ParTblRowID ChldTblID ChldTblRowID
->T_God ->MyGod ->T_Force ->Army
->T_Force ->Army ->T_Person ->John
->T_God ->MyGod ->T_Church ->Trinity
->T_Church ->Trinity ->T_Person ->John
T_Table
1 T_God 2 T_ArmedForce 3 T_Church 4 T_Person 5 T_Computer 6 T_Dog
T_God
10 MyGod
T_Force (Armed Forces)
11 Army
T_Church
12 Trinity
T_Person
13 John
14 Mary
15 Luke
T_Computer
16 Laptop1
T_Dog
17 Fido
Received on Fri Mar 05 2004 - 22:41:23 CET