I have a servo / next base table in mySQL that 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 could not find what I need
database design for subscribers and subscribers
SQL Followers and Followers
I need to have a system like this:
Suppose we are userB (we follow user A, followed by userC and userA)
I like to return a result that includes the next tracking / next state. For example, for userB:
id followedBy areWeFollowing 1 userA 1 2 userC 0
Thank you for your help!
Arda
source share