Maybe I am just being dense this morning but I am confused why you think 
that your nodes are different things depending on how many children they 
have (nodes, groups, entities, auuuugggghhh!)...

If you have  two sets of hierarchies that share the same nodes, you may 
want to build two trees rather than trying to make one tree pull double 
duty. Keep each tree in their own table and reference a record or records 
in the Nodes table from each node in the tree. That way both trees have 
their own structure and you only have one copy of each node. Perhaps a 
"normal" tree and a "groups" tree. Do your groups even need a tree? Could 
it be a table of groups and a second table that relates nodes to groups? 

Like I said, I could have really missed the point and if I did I humbly 
apologize.

Shawn Green
Database Administrator
Unimin Corporation - Spruce Pine

Chris <[EMAIL PROTECTED]> wrote on 10/27/2004 10:08:46 PM:

> Hi all,
> 
> I'm designing a small database, it's essentially a tree-structure. I'm 
> probably going to use a Modified Preorder Tree Traversal (On a side 
> note, how is it different than an  Unmodified Preorder Tree Traversal?).
> 
> Each node will have children etc, and those will have children, etc. 
> But I want to apply data to groups of nodes. So each child will either 
> be an actual entity, or a group of entities, which brings me to my 
problem.
> 
> If I have groups in one table, and entities in another, and a child can 
> be either a group or an entity I can't store that 'ID' in the same 
column.
> 
> What are my options at approaching this? I've thought about writing so 
> each child is a group, and every child is in a group (even if it's a 
> group of one). That would solve my problem, but it seems like there 
> could be a better solution.
> 
> Thanks,
> Chris
> 
> -- 
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]
> 

Reply via email to