MySQL language help needed
I'm working in DW3, and using PHP format for my database driven site.
The site draws on the database for points that have been inserted into the database.
What I am trying to accomplish is total the points by player_Id, and post their lastname, firstname, and rank it according to sum(points) in descending order.
My queery below, brings up the information I want...
But I just can't seem to come up with the right syntex to use to count() the records.
What happens is it ends up counting how many records it took to make the sum(points).
Here is the code I use to total the points. everything but the count is added.
SELECT sum(points) as 'points', lastname, firstname, player_id
WHERE month = '02'
GROUP BY player_id
ORDER BY sum(points) desc LIMIT 0, 200
here is a link to the working page.
I just need some help getting the darn thing to "count" records so I can use it for the "rank". For example next to the player_id ...I need to add a "rank" column, which would go from 1 to 200.
Any help would be deeply appreciated!