Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- select p1.name,p2.name,p3.name as friends from friend as f1 join friend as f2
- on f2.userid!=f1.userid and f2.friendid = f1.friendid
- join user1 as p1 on p1.id = f1.userid
- join user1 as p2 on p2.id = f2.userid
- join user1 as p3 on p3.id = f2.friendid
- order by f1.userid,f2.userid;
- ........................./mutual friend
Add Comment
Please, Sign In to add comment