Unanswered: Cant workout this query for the life in me!
Hi guys, I have a sports database with 3 tables; Player, Player Performance, Matches.
What I am trying to do is find all the Matches players have played in 2002 only. Then I SUM up the scores for every player from the "Player Performance" table. I then display the player with the highest score in 2002. I have got it to work but now I'm stuck on trying to include MAX in there to find the highest score. Suggestions would be greatly appreciated. Thank you.
I've tried both DESC and LIMIT but they're only superficial, i.e. effect views only. What I'm trying to do is add the MAX function in there.
I really want my queries and PHP code to stand out, so I've gone from basic recommendation of using subqueries and only INT and VARCHAR to using appropriate variables and JOINS. The only problem I have right now is that I can't workout the logic - should I calculate MAX first and then SUM that up?