php - How can I update multiple mysql columns of a row using the result of a select query? -


I have a review table that includes three ways to rate items, then each value for each column respectively There are three columns for.

I can use three nested queries in an update query, but I think it is disabled ... is there a way to update them all at once?

So far I have used this as my selected query:

  Item_Results from SELECT AVG (rating_1), AVG (rating_2), AVG (rating) 3 WHERE item_id = 1   

I do not know how to use the results of that query to update an item line.

You can use joining UPDATE :

Comments