title: Counts for distinct values in different tables where columns are common to separate tables
body: <p>I have no idea if that title conveys what I want it to.</p>
  
  <p>I have two tables containing phone records (one for each account) and I'd like to get call counts for the numbers that are common to each account. In other words:</p>
  
  <p>Table 1</p>
  
  <pre><code>Number  ...
  8675309
  8675309
  8675310
  8675310
  8675312
  </code></pre>
  
  <p>Table 2</p>
  
  <pre><code>Number  ...
  8675309
  8675309
  8675309
  8675310
  8675311
  </code></pre>
  
  <p>Querying with something like:</p>
  
  <pre><code>SELECT DISTINCT table1.number, COUNT(table1.number), COUNT(table2.number) FROM table1, table2 WHERE table1.number = table2.number GROUP BY table1.number
  </code></pre>
  
  <p>would hopefully produce:</p>
  
  <pre><code>8675309|2|3
  8675310|2|1
  </code></pre>
  
  <p>Instead, it currently produces something like:</p>
  
  <pre><code>8675309|6|6
  8675310|2|2
  </code></pre>
  
  <p>It appears to be multiplying the count from each table. Presumably, this is because I'm not joining the tables the way I should for this goal. Or because by the time I ask for COUNT(table1.number) the tables have already been joined in some multiplicative way. Should I not be doing a JOIN and instead something that would read like: "where table2.number CONTAINS(table1.number)"?</p>
  
  <p>Any tips?</p>