title: SQL: How to update all rows with a calculation?
body: <p>I'm trying to add in the <code>total price</code> for a pizza order based on the order <code>sub-total</code> and <code>tax</code>. I've been getting an error stating the subquery returned more than 1 value with this command:</p>
  
  <pre><code>DECLARE @orderTotal AS INT
  SET @orderTotal = (SELECT(SUM((orderSubtotal+tax) * (1 - discountAmount)))
                     FROM OrderProcessing GROUP BY orderID)
  UPDATE OrderProcessing
  SET orderTotalAmount = @orderTotal
  </code></pre>
  
  <p><code>discountAmount</code> equals a decimal number like <code>0.2</code> to represent a <code>20%</code> discount.</p>