I have a table called Follow, with three fields:
- Id (autoincrement int),
- UserId (int),
- Following (int)
If I have data like this:
ID UserId Following
--------------------------
1 2 3
2 3 2
3 2 5
4 2 6
5 3 5
How would I find user 2’s friends (ie: user 2 is following them, and they follow user 2)
I guess, in other words, if user ‘a’ follows user ‘b’, and user ‘b’ follows user ‘a’, how do I select user A ??
Try this: