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)
 More hierarchical sql help needed

Author  Topic 

james_b
Starting Member

9 Posts

Posted - 2004-08-05 : 12:45:59
ok, I've taken the advice I was given and got rid of the previous link table

so if I have the following:

PlaceId     PlaceName     PlaceBasedOnId
***********************************************

1    USA         <NULL>

2    UK        <NULL>

3    Florida        1

4    Yorkshire        2

5    Orlando        3

6    East_Yorkshire    4

7    Scarborough    6


How would I go about writing Sql to achieve a result similar to:


USA - Florida - Orlando

UK - Yorkshire - East_Yorkshire - Scarborough


bearing in mind that I might need to add a "sub-zone" of scarborough at some point (so sql must be able to cope with n dimensions?)

thanks for any help :)

james

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2004-08-05 : 12:51:57
have you read this?
http://www.sqlteam.com/item.asp?ItemID=8866

Go with the flow & have fun! Else fight the flow :)
Go to Top of Page

Seventhnight
Master Smack Fu Yak Hacker

2878 Posts

Posted - 2004-08-05 : 13:02:31
I also have one...
http://www.seventhnight.com/treeStructs.asp

Corey
Go to Top of Page
   

- Advertisement -