Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Recursive Queries revisited!

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2002-05-28 : 08:44:13
Marc writes "Dear Guru,

I have a problem similar to the one mentioned in http://www.4guysfromrolla.com/webtech/sqlguru/q120899-1.shtml. But I have a sub-node ID and try to get the whole list of nodes 'above' it excluding the root node. Let me clarify a little:

categoryID
parentID
Name

Given a categoryID, I would like to get a list of the parent's IDs all the way through the tree with the exception of the root node.

Can I use a similar technique as in the article? - Many thanks for any hints and tips!!

Best regards,

Marc"

Page47
Master Smack Fu Yak Hacker

2878 Posts

Posted - 2002-05-28 : 08:58:55
You can continue to self-join for every layer of 'depth' in your hiearchy. I would suggestiong taking a look at this article for more ideas.

<O>
Go to Top of Page
   

- Advertisement -