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)
 Parent Child Relations

Author  Topic 

tml
Starting Member

2 Posts

Posted - 2008-12-10 : 19:16:40
I have a table I'm using for site navigation. I can query the top level pages by checking to see if the navigation record doesn't have a ParentNavigationID. What I want to accomplish is getting the number of child pages each top level navigation has in the same query.

Can someone provide a sample of how I would return:

NavigationID, Name, ChildRecords

Thanks!

tosscrosby
Aged Yak Warrior

676 Posts

Posted - 2008-12-11 : 12:51:10
Check out the link below:

http://www.sqlteam.com/article/recursive-joins-or-parent-child-trees

Terry
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2008-12-11 : 13:32:17
how many levels deep?


Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx

Add yourself!
http://www.frappr.com/sqlteam



Go to Top of Page
   

- Advertisement -