UPDATE PlayerLeague l
JOIN PlayerStat s ON l.player_id=s.player_id
SET l.league_id=8
WHERE l.league_id=2
ORDER BY s.score
DESC LIMIT 5
そして、私はエラーがあります:
{ [Error: ER_WRONG_USAGE: Incorrect usage of UPDATE and ORDER BY]
code: 'ER_WRONG_USAGE', index: 0 }
どういう意味?
私はこれを試します:
UPDATE PlayerLeague l
SET l.league_id=8
WHERE l.player_id IN
(SELECT player_id FROM PlayerStat s
JOIN PlayerLeague l ON s.player_id=l.player_id
WHERE l.league_id=2
ORDER BY s.score
DESC LIMIT 5)
しかし、これも間違っています。