Twitter style following-follower table in SQL
问题 I have a basic follower/following table in mySQL which looks like this. id user_id follower_id 1 userA userB 2 userC userA 3 userA userC 4 userB userC 5 userB userA I checked these topics but couldnt find what I need database design for 'followers' and 'followings'? SQL Following and Followers What I need is to have a system like this: Assume we are userB ( we follow userA, we are followed by userC and userA) I like to return a result that includes this follower/following state. For example