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
 Transact-SQL (2000)
 Recursive query!!!!!

Author  Topic 

rahmanji
Starting Member

1 Post

Posted - 2003-01-12 : 06:27:06
how do i display a parent message with all its sub topic and child node , i want to display all the topics that was started by the main parent

All i want is a select statement which could display all the nodeid of (all the children having the same parent as of a node)its brothers and all the nodes id of its nephew(s)
here is the query i have been using but it doesn't work for its nephew


select distinct(a.nodeid) from coursenodetable a
join coursenodetable b
on a.parentid=b.nodeid
where a.courseid=145 and a.parentid = 5





robvolk
Most Valuable Yak

15732 Posts

Posted - 2003-01-12 : 08:49:45
http://www.sqlteam.com/SearchResults.asp?SearchTerms=trees

Some of the articles have several links in them to other tree discussion, be sure to read all of them.

Go to Top of Page
   

- Advertisement -