No, my query will compute the number of nodes from the root to each individual node, and then select the maximum value, which will be the longest path.
If you can't use a query, you'll have to do a recursive descent. However, if you're already doing one to populate the left/right fields, can you just compute it then? cheers, barneyb On 7/10/05, Jeff Chastain <[EMAIL PROTECTED]> wrote: > Basically, this is being modeled in a modified pre-order tree traversal > where the left and right numbers come from traversing the edges of the tree. > The number of descendants for a given node would result from the > calculation, (right - left - 1) / 2 ... so, (18 - 1 - 1) / 2 = 8 descendants > from the root node. > > I should have specified before, but this tree/table is actually in a > 2-dimensional array format, so queries are not really usable. > > Either way, it would appear that the query you specified would calculate the > total number of nodes in the tree (9), not the depth of the tree(4). What I > am trying to find is the length of the longest branch of the tree, and short > of writing a recursive function, I am not sure how else to calculate this. > > Thanks > -- Jeff > > -- Barney Boisvert [EMAIL PROTECTED] 360.319.6145 http://www.barneyb.com/ Got Gmail? I have 50 invites. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Logware (www.logware.us): a new and convenient web-based time tracking application. Start tracking and documenting hours spent on a project or with a client with Logware today. Try it for free with a 15 day trial account. http://www.houseoffusion.com/banners/view.cfm?bannerid=67 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:211518 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

