Say I have a table. This is a scaled down version of the actual table. Call it tblusers. 3 columns with the header name of USERNAME, Zone 1, Zone 2
Example table:
USERNAME |zone1| Zone 2
john |3| 1
pete |2| 3
rick |5| 7
The numbers are just points. What I want to do is create a string of code that will add the points for each user, then display order highest to lowest the username and his total points. Let's just say we want the top 5.
So say i use a Select statement like
Select USERNAME, (zone1 + zone2) FROM tblUsers
to get the username and his corresponding total, but ranked according to the total, high to low and display it in an asp page?
According to those example points, Rick would have 12, pete would have 5, and John would 4.
So we'd want a display like
RICK 12
PETE 5
JOHN 4
I hope i was clear on how to ask this question. Thanks!
Example table:
USERNAME |zone1| Zone 2
john |3| 1
pete |2| 3
rick |5| 7
The numbers are just points. What I want to do is create a string of code that will add the points for each user, then display order highest to lowest the username and his total points. Let's just say we want the top 5.
So say i use a Select statement like
Select USERNAME, (zone1 + zone2) FROM tblUsers
to get the username and his corresponding total, but ranked according to the total, high to low and display it in an asp page?
According to those example points, Rick would have 12, pete would have 5, and John would 4.
So we'd want a display like
RICK 12
PETE 5
JOHN 4
I hope i was clear on how to ask this question. Thanks!
Comment