SQL Relative Rank Question for Ranking Module

  Post new topicReply to topicPrintable Version
<< View previous topic View next topic >>
Share: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
#1   SQL Relative Rank Question for Ranking Module
minusme
CZ Newbie
minusme has been a member for over 20 year's 20 Year Member
usa.gif newyork.gif
Status: Offline
Joined: Jun 18, 2004
0.00 posts per day
Posts: 12
Points: 4,740
   
I have created a module to rank unsigned bands based on total song plays from my web site. I am having a problem resolving the relative rank (based on total plays) from my artist database.

This is the SQL I use to get the totals, which works fine:

SELECT SUM( hifi_scount_total + lofi_scount_total ) AS count FROM {$jamroom_db['scounter']} WHERE band_id=10

What I want to do is determine the RANK of "band_id=10" relative to the other bands. Since each band ID has multiple songs, I will need to use the group function, but have thusfar been unsuccessful.

Ultimately, I want my output to look like:
Currently "artistname" is ranked "x" out of "y" artists.

If anyone can shed some light, I would be MOST greatful!!!!
minusme



Back to top Reply with quote
Display posts from previous:      
Add To: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
<< View previous topic View next topic >>
Post new topicReply to topic

Jump to 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum