Mysql
 sql >> Database >  >> RDS >> Mysql

Aggiorna la tabella con SUM da un'altra tabella

UPDATE playercareer c
INNER JOIN (
  SELECT gameplayer, SUM(points) as total
  FROM games
  GROUP BY gameplayer
) x ON c.playercareername = x.gameplayer
SET c.playercareerpoints = x.total