title: Mysql compare two tables
body: <p>I have two tables in the same database with matching id's.</p>
  
  <p>The first table is <code>accounts</code></p>
  
  <pre><code>id - account_access - name - email - city - state - etc...  
  1 - 1 - Mark - mark@mark.com - Seattle - WA - blah,blah,blah  
  2 - 1 - Dave - dave@dave.com - Portland - OR - blah,blah,blah  
  3 - 0 - Jake - jake@jake.com - San Francisco - CA - blah,blah,blah  
  4 - 1 - Julie - julie@julie.com - Los Andeles - CA - blah,blah,blah
  </code></pre>
  
  <p>The second table is <code>members</code></p>
  
  <pre><code> id - status - score - IQ  
   1 - 4 - 9000 - 108  
   2 - 5 - 8000 - 90  
   3 - 5 - 1000 - 25 (Disclaimer: Any relation to real people is purely coincidental)  
   4 - 5 - 5000 - 60
  </code></pre>
  
  <p>Since Jake wasn't very bright, he has zero access to the account.</p>
  
  <p>What I want to know is how many people with account_access (1) have status (5), or how many people with status (5) have access.<br>
  I'm not familiar with how to word the SELECT statement comparing two tables, i would     like to know number of rows and then to also retrieve the data to display.</p>