Guest User

Untitled

a guest
Jun 21st, 2018
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. select p1.name,p2.name,p3.name as friends from friend as f1 join friend as f2
  2. on f2.userid!=f1.userid and f2.friendid = f1.friendid
  3. join user1 as p1 on p1.id = f1.userid
  4. join user1 as p2 on p2.id = f2.userid
  5. join user1 as p3 on p3.id = f2.friendid
  6. order by f1.userid,f2.userid;
  7.  
  8. ........................./mutual friend
Add Comment
Please, Sign In to add comment