I'm trying to make an update, and here is my query
UPDATE t1
SET DOY = isnull(Sum(t2.Price),0)- isnull(Sum(t2.RestOfPrice),0)
FROM customermaster t1 INNER JOIN History t2
ON t1.CustomerID = t2.CustomerID
The query throw an error
An aggregate may not appear in the set list of an UPDATE statement.

