title: subtract value in one table from value in second table - Set result as value in second table
body: <p>I have two tables. First table is <code>Shipping</code> with columns <code>Product</code>, <code>Quantity</code> and <code>ID</code>. Second table is <code>Inventory</code> with columns <code>Product</code> and <code>Total</code>.</p>
  
  <p>I want to take the value of <code>Shipping.Quantity</code> and subtract it from the value in <code>Inventory.Total</code> WHERE the <code>Product</code> values match in each table and <code>Shipping.ID</code> is value in url (<code>$onum</code>).  Then I want to set the new value as Inventory.Total for that product.    </p>
  
  <p>Best I could come up with:</p>
  
  <pre><code>UPDATE Inventory.Total 
  CROSS JOIN Shipping 
  SET Inventory.total=(Inventorytotal-Shipping.Quantity) 
  WHERE Inventory.Product=Shipping.Product 
    AND Shipping.ID=$onum
  </code></pre>