UPDATE scores SET diff=(score-rating)*113/Slope; SELECT ID,AVG(diff) FROM scores GROUP BY ID;
There are two tables witht the names scores and users the fields are as follows:
Scores: ID, score, rating, slope, diff
Users: ID, Last Name, First Name, Avg_diff, Handicp
When I run the MySQL query I get an array of the ID and avgerage of the diff column for each user. I then need to manually update each user's Avg_diff before I complete the process with
UPDATE users SET handicp=(AVG_diff*.96)
Is there anyway to store each of the AVG values to put into the Avg_diff column by ID? The more users I get the more time this query takes me.
Also What is the format for the ROUND command if I want to do only 1 decimal place?