title: i want to fetch the total user count of given referral ids in table
body: <p>hi i want to fetch the total user count of given referral ids in table
  i have tried using left join but i am getting duplicate results from mysql.</p>
  
  <pre><code>i am attaching of screenshot of my table.
  when user register we ask the sponser id which is actually the referral id 
  of other user.
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/X4sdt.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/X4sdt.png" alt="table containing the referral id and sponser id"></a></p>