Hi,
I have two tables
1.User table - UserId is primary key
2.Friends table - FriendsId is primary keys
In User table I have all users list
I want to get records from following relation
User->Friend->SubFriend
User has some Friends and
Each Friend has some subfriends
requirement:
How to write select statement for get all subfriends list,
Thank you in advance
How to write select statement for find friends( like facebook find friends concept) ?
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.

Jignesh TrivediRank #16 · 50.3K reputationPosted Jan 24, 2012, 6:20 PM EST
please define relationship between these three table and what is filteration you required?
simply u write
select s.subfriendname, f.friendname, u.username from SubFriend s
left outer join Friend f on s.Friendid = f.frendid
left outer join user u on u.userid = f.userid
hope this help.