You could set your table up in a "modified preorder tree traversal", so
each node has a "LFT" and "RGT" numeric value. I've done this in several
instances and it works great. 

See examples in this article:
http://www.sitepoint.com/article/hierarchical-data-database or google
for "modified preorder"

The query for you would be simple in this instance, assuming you're at
node X with rgt value R and L

Select n1.* From nodes n1, nodes n2
Where n2.nodeID=YOUR_ID
And n1.rgt<=n2.rgt and n1.lft>=n2.lft
Order by n1.rgt

Those are your nodes from the root until your desired node.

HTH,
dov


-----Original Message-----
From: Micha Schopman [mailto:[EMAIL PROTECTED] 
Sent: Thursday, December 23, 2004 5:25 AM
To: CF-Talk
Subject: RE: In One?

"You could always cheat and have a dynamically-sized text field
containing a comma separated list of the parentCategoryID hierarchy :)"

*cough* I think I misunderstood this suggestion ;) Even then, varchar
would be a better choice :P

Micha Schopman
Software Engineer

Modern Media, Databankweg 12 M, 3821 AL  Amersfoort Tel 033-4535377, Fax
033-4535388 KvK Amersfoort 39081679, Rabo 39.48.05.380





~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Special thanks to the CF Community Suite Silver Sponsor - CFDynamics
http://www.cfdynamics.com

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:188615
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to