title: An aggregate may not appear in the set list of an UPDATE statement. Error
body: <p>I'm trying to update the sum of one table contents to another table using this query.</p>
  
  <pre><code>update c set  c.amountwithoutvat = SUM(c.amountwithvat / 1.25),
  c.profitamount=(SUM(rp.amountwithtvat / 1.25) - (ps.netpurchaseprice*rp.qtysold)),
  c.profitpercent= ((SUM(c.amountwithvat / 1.25) - (ps.netpurchaseprice*c.qtysold)) / SUM(c.amountwithvat / 1.25)) * 100
   from data.cashierdailysales c inner join receipts r on c.salesdate=r.RecDate
  inner join data.receipt_productlines rp on r.seriesno=rp.seriesno 
  inner join product_supplier ps on ps.productid=rp.productid 
  inner join product_chain pc on pc.productid=ps.productid and pc.activesupplier=ps.supplierid
   where c.salesdate between CONVERT(date,'20-02-2014',104) and CONVERT(date,'03-03-2014',104) 
  </code></pre>
  
  <p>But i get this error, </p>
  
  <pre><code>`an aggregate may not appear in the set list of an UPDATE statement.
  </code></pre>
  
  <p>And when i use group by at the end I get, </p>
  
  <p><code>Incorrect syntax near the keyword 'group'</code> </p>