how to update one table with results from another mysql query
===

i am seeking help on updating one column in a table with results from another query.

table names:
    
    saleitems - fields are (itemid,quantity,saledate) 
    stockbuffers - fields are (itemid,bufferquantity)
i am getting the buffer quantity with the following query from sale items table:
   
    SELECT (SUM(saleitems.quantity / 6)) * 6 FROM saleitems WHERE saleitems.saledate BETWEEN date_sub(curdate(),interval 180 day) AND NOW() GROUP BY saleitems.itemid

i want to update the column buffer quantity from the above query's result. can anyone help. greatly appreaciate.
