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)
 View tree Of all parents of particular child

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2004-11-04 : 08:37:37
Nilesh Ramesh Sawant writes "Hi,

I've a praticular situation. Here it is.
I've one table with following definition.

FieldID
FieldName
ParentID

ParentID=FieldID in case of child record.

Now the problem is, I need to show all the FieldName is FieldID ascending Order for a particular FieldName.

ie.
Table -
FieldID FieldName ParentID
1 A 0
2 B 0
3 C 2
4 D 3
5 E 4

Now I need out put for search on "E" as following

VIEW -
FieldID FieldName ParentID
2 B 0
3 C 2
4 D 3
5 E 4


I'm unable to do anything in last 8 hours. Could you help me?

Thank you.


Nilesh"

Seventhnight
Master Smack Fu Yak Hacker

2878 Posts

Posted - 2004-11-04 : 09:24:18
Read through this:

http://www.seventhnight.com/treestructs.asp

Pay close attention to part 2 where it talks about 'All the parents of a Node'

Corey
Go to Top of Page
   

- Advertisement -