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.
| Author |
Topic |
|
tpiazza55
Posting Yak Master
162 Posts |
Posted - 2010-12-07 : 12:32:59
|
| I am trying to write a query that will retrieve all the children for a parent for N level deepsBasically have accountid, parentid columnsif parentid is null it is the top levelthe child at every other level is determined by the parentid column.how can i write a query that will return the parent and group the children to that parent in order.basically keep looping until there are no more children in the sublevels -- kind of a like a treeview. |
|
|
russell
Pyro-ma-ni-yak
5072 Posts |
Posted - 2010-12-07 : 12:36:06
|
| http://msdn.microsoft.com/en-us/library/ms186243.aspx |
 |
|
|
tpiazza55
Posting Yak Master
162 Posts |
Posted - 2010-12-07 : 12:57:48
|
| thanks |
 |
|
|
|
|
|