|
-
Jul 28th, 2002, 02:27 PM
#1
Thread Starter
Lively Member
SQL statement with sum()
could someone please help me with this...i'm not too sure how to address it here's an example of what i need to give you an idea.
say there 20 players, each playing whatever game/sport each day, a player can get any # of points in one day and i want to get a list (in order) of players listed by the highest total # of points.
to make it simple i have ID, player, date, points
getting the sum of 1 players points isnt difficult, but i dont have a clue how to orderly get each players total points...pleeease help me
SELECT sum(points) AS sum FROM players WHERE player="whoever";
will get one player's points, but i dont know how to get each and list them highest to lowest
-
Jul 28th, 2002, 04:26 PM
#2
PowerPoster
Maybe try this:
SELECT players, sum(points) As Sum FROM players GROUP BY player
Last edited by abdul; Jul 28th, 2002 at 04:36 PM.
Baaaaaaaaah
-
Jul 29th, 2002, 11:06 AM
#3
Thread Starter
Lively Member
thanks alot, that got me to what i wanted.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|