I am probably missing something really obvious here, but I am attempting to make a code to show the highscore for a game where you kill other players/monsters. The highscore is supposed to show the top 15 players by average number of kills per death that they have, but I can’t find a nice why to do this with the database information I have.
The database stores records by each kill or death is 1 record into the ‘killschart’ table. The table itself looks like this:
http://la.wrence.in/u/081115042.png (It didn’t allow me to include an image/link, so I have just written to it)
Where the “killed_by_uuid” is set when a player (using the value of the box) kills something, and then the “killed_uuid” is set when the player (using the “killed_uuid” value) is set when a player dies for whatever reason. The other data isn’t important to what I am trying to show here.
I can get it to show the values for kills and deaths separately because I simply group by the “killed_by_uuid” and “killed_uuid” respectively and then COUNT(*) the number of records for each. However I am now looking to actually compare the number of kills a player gets against how many times they have died, and order the results according to that number. (The player uuid’s are the same for each column incase that wasn’t clear)
Sorry if my explanation isn’t what it’s meant to be, if anyone needs more information please contact me; I am normally fine with SQL stuffs; but have just reached a wall with this.
Thanks so much to anyone who can help me.