I have a table called leaderboard
which I create
create temporary table leaderboard
(
rank integer primary key auto_increment,
score_id integer,
game varchar(65),
user_id integer
)
select
id,
highscore,
playername
from
players
order by
highscore desc
This is fine but am now trying to update the table with a join in the id.
UPDATE players
SET players.rank = leaderboard.rank
FROM players
JOIN leaderboard ON players.id = leaderboard.id
but get an error in the mysql? And pointers would be good
error is
…the right syntax to use near ‘FROM players JOIN leaderboard ON
players.id = leaderboard.id’ at line 1
Maybe something like this:
Mysql syntax is different from tsql. That style would work on mssql