title: Select most "popular" follower for particular person. The more followers someone has, the more "popular" they are
body: <blockquote>
    <p>Find most "popular" follower for a specific person. The more followers someone has, the more
    "popular" they are.</p>
  </blockquote>
  
  <p>I need SQL query to select most popular follower of particular people.</p>
  
  <p>My Table - (followers)</p>
  
  <pre><code>id | person_id | follower_person_id
  1    1            2
  2    1            3
  3    2            1
  4    2            4
  5    3            1
  6    3            2
  7    3            4
  8    4            3
  </code></pre>
  
  <blockquote>
    <p>For example person_id 1 has total 2 follower, person_id 2 has total 2
    followers, person_id 3 has total 3 followers and person_id 4 has total
    2 followers.</p>
    
    <p>Therefore, person_id 3 is most popular follower for person_id 1, 
    person_id 1 is most popular follower for person_id 2 and so on...</p>
  </blockquote>
  
  <p>Here is my query but its not working... </p>
  
  <pre><code>SELECT follower_person_id FROM followers f where f.person_id = 1 group by f.follower_person_id having max(select count(*) from followers where person_id = f.follower_person_id)
  </code></pre>