I have got two tables:
Person(ID,Name,LastBuy,Price_Sum)
Sales(ID,Person_ID,Date,Price)
There is a relationship between Person.ID and Sales.Person_ID. Now I need to write a query in order to calculate sum of Price field for every person and update result into the Person.Price_Sum field, Then just find the latest buy of everyone through Sales.Date and update into the Person.Lastbuy.
That sounds complex, I would be really grateful if someone helps me.