I\'m trying to update a field in the database to the sum of its joined values:
UPDATE P SET extrasPrice = SUM(E.price) FROM dbo.BookingPitchExtras AS E INNER
Use a sub query similar to the below.
UPDATE P SET extrasPrice = sub.TotalPrice from BookingPitches p inner join (Select PitchID, Sum(Price) TotalPrice from dbo.BookingPitchExtras Where [Required] = 1 Group by Pitchid ) as Sub on p.Id = e.PitchId where p.BookingId = 1