title: SQL Update to the SUM of its joined values
body: <p>I'm trying to update a field in the database to the sum of its joined values:</p>
  
  <pre><code>UPDATE P
  SET extrasPrice = SUM(E.price)
  FROM dbo.BookingPitchExtras AS E
  INNER JOIN dbo.BookingPitches AS P ON E.pitchID = P.ID
      AND P.bookingID = 1
  WHERE E.[required] = 1
  </code></pre>
  
  <p>When I run this I get the following error:</p>
  
  <pre><code>"An aggregate may not appear in the set list of an UPDATE statement."
  </code></pre>
  
  <p>Any ideas?</p>