I have Tables Like
1) User Which Holds The Master Data Like
User ID Name OtherColumns 1 Banshi Nothing 2 Banshi2 Nothing 3 Banshi3 Nothing
2)Second Table “Friends” Holds Data Like
ID UserID FriendID FriendCategory 1 1 2 2 2 2 1 2 3 4 1 2 4 1 4 2
3)Third Table “Subscribers” Holds Data Like
ID SubscribersID SubscribToID FriendCategory 1 1 3 3 2 1 4 3
4)Fourth Table “FriendCategory” Like
ID Name 2 Friends 3 Subscribers
5)Fifth Table “Posts” Contains Data Like
PostID UserID Post 1 2 Hello Dear Post By Banshi2 2 3 Hello Dear Post By Banshi3 3 4 Hello Dear Post By Banshi4
Now Being User 1 i Need Data Like
A) I need Data if Posted By My Friends
B) I need Data if Posted By i am Subscribed to
c) If User is My Friend Subscribed as Well Then it Must Show Friend not i am Subscribed
My Data Something Like
UserID Name Post Category 2 Banshi2 Hello Dear Post By Banshi2 Friends 3 Banshi3 Hello Dear Post By Banshi3 I Am Subcriber 4 Banshi4 Hello Dear Post By Banshi4 Friends
Please Suugest Me How to Get Such a Out put in Sql Server 2008
Thanks in Advance
Banshi
For getting data if posted by friends
You can do it similarly for getting data to i am subscribedto .
Well, i didn’t get what you were trying to say here .