I’m trying to create elo based leaderboard from multiple tables. Table structures are shown down below. What I am looking for is query that would sum elo from all tables into one for every single player that is in any of the tables and then order it desc to get top 10 players with global elo.
Does anyone know how to make that work? I am struggling on that problem for quite some time. All I was able to do was get global elo of one specific player but what I need is to get top 10 players. Thanks in advance for answers.
SELECT `name`, SUM(elo) AS elo FROM (SELECT `name`, `elo` FROM players_mode_boxing UNION SELECT `name`, `elo` FROM players_mode_sumo UNION SELECT `name`, `elo` FROM players_mode_thebridges) X GROUP BY `name` ORDER BY `elo` DESC LIMIT 10
Answered By – David Malich
Answer Checked By – Timothy Miller (BugsFixing Admin)