2
I need a query that returns to each map the players who had battles on it, the amount of battles each player had (on the respective map), the total time played (per player on the respective map), and the amount of transgressions (per player on the respective map). The tables are: Classification, Battles and trangressor_list and are structured as the following:
Classification
Id | Player_id | Battle_id | Time_played
Battles
Id | Map_id
trangressor_list
Id | Transgressor_id | Battle_id
The wish I tried was this::
SELECT Map_Id, Player_Id, COUNT(Player_Id) AS Quantidade, SUM(Time_Played) AS 'Time Played'
FROM classification, battles, trangressor_list
WHERE classification.Battle_Id = battles.Id AND trangressor_list.Battle_Id = battles.Id
GROUP BY Player_Id, Map_Id
ORDER BY Map_Id ASC, Player_Id ASC
;
this works partially but is not exactly what I need
Does the Transgressor _Id column contain player identification? // In the same battle, can the player have more than one transgression? // You can add sample data to test?
– José Diz
Yes, Transgressor _Id contains player identification and may have more than one transgression per battle
– Roberto Gomes