title: mysql select difference (minus)
body: <p>I have two tables:</p>
  
  <p>table 1: stock</p>
  
  <pre><code>uid|item|
  --------
  01 |value1
  02 |value2
  02 |value2
  etc|etc
  </code></pre>
  
  <p>table 2: sales</p>
  
  <pre><code>uid|item
  --------
  02|value2
  02|value2
  02|value2
  </code></pre>
  
  <p>How do I get the difference between stock (sum of one item) - total sales (sum) of a product? I have tried to calculate the difference between two sums but sometimes I subtract "nothing" from stock, because maybe an item is not present in the sales table and I get something like:</p>
  
  <p>2 - NULL = NULL and I want something like 2-0 = 2</p>