title: SQL join without losing rows
body: <p>I have 2 tables with the same schema of userID, category, count.  I need a query to sum the count of each userID/category pair.  Sometimes a pair will exist in one table and not the other.  I'm having trouble doing a join without losing the rows where a userID/category pair only exists in 1 table.  This is what I'm trying (without success):</p>
  
  <pre><code>select a.user, a.category, count=a.count+b.count
  from #temp1 a join #temp2 b
  on a.user = b.user and a.category = b.category
  </code></pre>
  
  <p>Example:</p>
  
  <p>Input:</p>
  
  <pre><code>user    category    count
  id1     catB        3
  id2     catG        9
  id3     catW        17
  
  user    category    count
  id1     catB        1
  id2     catM        5
  id3     catW        13
  </code></pre>
  
  <p>Desired Output:</p>
  
  <pre><code>user    category    count
  id1     catB        4
  id2     catG        9
  id2     catM        5
  id3     catW        30
  </code></pre>
  
  <p>Update: "count" is not the actual column name.  I just used it for the sake of this example,  and I forgot it's a reserved word.</p>