mysql - Update from Inner join syntax -


it seems dont have syntax quite right , have tried few different ways of writing it, doing wrong?

update `allranks` set `allranks`.`ranktwo` = `therankings`.`rank` `allranks` inner join `therankings` on (`therankings`.`player name` = `allranks`.`player name`) 

the correct mysql syntax is:

update allranks ar inner join        therankings r        on ar.`player name` = r.`player name`     set ar.ranktwo = r.rank; 

notice how table aliases make query easier write , read.


Comments

Popular posts from this blog

dns - How To Use Custom Nameserver On Free Cloudflare? -

python - Pygame screen.blit not working -

c# - Web API response xml language -