I have a table with Subscription information consists of subscription id, subscriber user id, subscribed user id and block flag as belowsubscription_id subscriber_user_id subcribed_user_id blocksub1 u8 u24 Fsub2 u25 u26 Fsub3 u26 u25 Fsub4 u16 u15 Fsub5 u5 u13 Fsub6 u10 u13 Fsub7 u6 u10 Fsub8 u8 u9 Tsub9 u2 u24 Fsub10 u3 u24 Tsub11 u19 u20 Fsub12 u18 u21 Fsub13 u27 u26 T
If one user blocks the other user, the block flag is set as true.I want to find a user who has the most non-blocking subscribers. How would I write a query for that?This is what I triedselect max(S.subscriber_user_id)from Subscription S where S.Subscriber_user_id IN(Select S.Subscriber_user_id, S.block from Subscription Swhere S.block = 'F');