View Single Post
  #6 (permalink)  
Old June 11th, 2008, 08:41 PM
Old Pedant Old Pedant is offline
Friend of Wrox
 
Join Date: Jun 2008
Location: Snohomish, WA, USA
Posts: 1,649
Thanks: 3
Thanked 141 Times in 140 Posts
Default

That last query produces this output (your data, except names changed/simplified a tad...sorry):
Code:
id   parentid path              name
1    0        0001              root1
3    1        0001:0003         r1, child 1
6    3        0001:0003:0006    r1, c1, grandkid 1
7    3        0001:0003:0007    r1, c1, grandkid2
4    1        0001:0004         r1, child 2
2    0        0002              root2
5    2        0002:0005         r2, child 1