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 |
|
ewebb02
Starting Member
6 Posts |
Posted - 2006-05-23 : 16:32:07
|
| I'm not sure how many of you all might understand what I'm asking, and I'm sure it's a relatively simple query to write, it's just alluded us so far.I have a table that links a user with a list of other user's he/she knows. Similar to a buddy list/friend's list. For an example of what I'm looking for:My User Bob has friends of John, Frank, Alice.Alice has friends of James, Bret, LoganLogan has a friends of Amber and PorterUser Bob goes to view Porter's information. I want to be able to show the lineage of how Bob knows Porter.Bob -> Alice -> Logan -> PorterThe table structure has the user_id (Bob) and then the friend_id (Alice). Each user has n entries for each of their n friends.Anythoughts on how to approach this scenario?Thank you in advance. :) |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
|
|
|
|
|