I have a social network similar to myspace/facebook. In my code you are either a person\'s friend or not a friend, so I show all actions from people you are friends with (in
you do a subquery:
SELECT DISTINCT user_id FROM friends WHERE friend_id IN (SELECT user_id FROM friends WHERE friend_id = 1)