This really...really pains me to write this, only because I know I have done it before many...many times.. but for the life of me I am blanking on this.
I need to make sort of a top downloader list. All the data is in a MYSQL table called xfer_stats. In this table there are a ton of columns but the ones I am interested in are usr,bytes I want to add up all the bytes per user and display. Listing all the users in order of most to least. Something similar might be done with money values in a similar application.
How do I go about doing this??
Top Listing
Moderator: General Moderators
- scorphus
- Forum Regular
- Posts: 589
- Joined: Fri May 09, 2003 11:53 pm
- Location: Belo Horizonte, Brazil
- Contact:
Code: Select all
Select usr, sum(bytes) as sumBytes from xfer_stats group by usr order by sumBytes desc;