title: Left Join Count
body: <p>Ok i think i am going about this the wrong way possibly, but i have tried so many different ideas and cannot seem to find the right way to do this, so hoped somebody might be able to nudge me in the right direction.</p>
  
  <p>Basically i record the ip address of visitors as they visit my website, and then identify which of the ip addresses belong to businesses.</p>
  
  <p>So table one has a long list of ip addresses of people who have visited my website and table two has a list of ip addresses i have identified.</p>
  
  <p>Now what i am trying to do is find out how many of the IP addresses in Table 1 have been identified.</p>
  
  <p>The code i have below matches and groups the ip addresses and shows me how many times the ip address in table 2 appears in table one.</p>
  
  <p>However what i am trying to get is just one number and not a group of numbers, i have tried writing the query several ways but can only get it to work with a group</p>
  
  <pre><code>SELECT ip_stats.ip, COUNT(ip_stats.ip) 
  FROM ip_stats 
  LEFT JOIN main USING (ip)
  GROUP BY ip_stats.ip
  </code></pre>
  
  <p>ip_stats is table one and has the long list of people visiting my website.
  main is table two and contains the details of the IP addresses which have been identified.</p>
  
  <p>both tables have their own primary key both are which are id.</p>
  
  <p>Thanks</p>