update query problem

Y

Yorkie118

Hi, I am building a Rating system for a local tennis league, and have hit a
problem.
I can calculate the points gain/loss (e.g +/-15) from the result, but when I
try to simultaneously update the old ratings by this amount, I get the error
'Duplicate Output Destination'. If I update the winner first, then the loser,
the losers figure gets influenced by the winners updated figure! So I get an
instance where the winner gains 15 pts, but the loser only loses 14. Is it
possible to do a simultaneous update?
Here is the SQL:-
UPDATE Player AS Player_1 INNER JOIN (Player INNER JOIN NewRatings ON
Player.PlayerID = NewRatings.Winner) ON Player_1.PlayerID = NewRatings.Loser
SET Player.Rating = [WinnerNewRating], Player_1.Rating = [LoserNewRating];
Any ideas appreciated.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top