|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
mysql SUM() question
I have a table result where there are some fields, date, match_id, club_id and now I would like to make a ranking list, so I would like to summarize al the points form the points filed based on the club_id's eg
if I have: club_id points 1 1 1 2 2 0 3 1 then I would like to get the rank order like: club_id 1 3 2 if anyone understand what I'm trying to explain and have an idea to to make so I would be glad .patrik |
|
#2
|
||||
|
||||
|
You might try something like SELECT SUM(points) as points, club_id FROM table GROUP BY club_id ORDER BY points. That's untested. A group by and an order by of some type should show you what you need, at any rate.
|
|
#3
|
|||
|
|||
|
It worked great, thx a lot
.p |
![]() |
| Viewing: Dev Articles Community Forums > Databases > MySQL Development > mysql SUM() question |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|