I have two tables
users table:
id|name
user_relationships
id | user_id | friend_id
and want to ge
You could try something like this:
select id, name from users where id in
(select friend_id from user_relationships where user_id = @user1_id and friend_id in
(select friend_id from user_relationships where user_id = @user2_id)
)
This should return all mutual friends of users with the IDs @user1_id and @user2_id. It's not tested yet, but should provide a starting point...