vendredi 6 février 2015

Nice query to get my friends


my table has this structure:



User_ID | Followed_ID


Example row:



33 | 36


Means that user 33 follows user 36.


If exists a record like



36 | 33


then the two users are considered friends. What's the cleanest way to get all friends of(for example) user 36? Thanks.





Aucun commentaire:

Enregistrer un commentaire