MySQL Forums
Forum List  »  Newbie

SUM problem.
Posted by: Patric Andersson
Date: March 12, 2009 03:29AM

Or if it's even SUM I should use..... well, on to describe my problem.
Ok, to make it short so I can understand a simple answer how to solve this :)
Ok, I have a database containing :

Ok, what I info I have.
In a year we have 11 tournaments.
Not every user is in every tournament...
I want to "print" a sorted table based on the top 8 (out of the 11) results of the tournaments. (I hope that one made sense).

Lets say we have users (A,B,C,D,E... etc).
And we have 11 torneys (1,2,3... etc)
And then in result I save how many points each user gets in each torney....
So basicly A1=5, A2=0, A3=10 etc...

Now, if I wanted to SUM A1 - A11 (that's no problem), but what I want to do is just sum the top 8 out of A1 - A11, then sum the top 8 out of B1 - B11 and so on.

Then I want to show it sorted by the sum of the top8 results.

I have no problem sorting it by the sum of all 11, but how do I sort it by the sum of just the top 8 out of the 11 ?

I hope this all made sense on what I want to do.

Options: ReplyQuote

Written By
SUM problem.
March 12, 2009 03:29AM
March 12, 2009 09:52AM
March 13, 2009 07:10PM
March 13, 2009 11:10PM
March 14, 2009 04:01PM
March 14, 2009 06:40PM
March 15, 2009 07:54AM
March 15, 2009 10:41AM
March 15, 2009 10:35PM
March 16, 2009 09:33AM
March 16, 2009 09:52AM
March 16, 2009 02:46PM
March 16, 2009 04:15PM
March 17, 2009 02:11PM
March 17, 2009 05:03PM
March 17, 2009 06:31PM
March 17, 2009 10:17PM
March 18, 2009 06:03AM
March 15, 2009 05:41PM
March 15, 2009 07:14PM
March 16, 2009 08:34AM
March 18, 2009 12:52AM
March 21, 2009 05:58AM
March 21, 2009 11:13AM
March 22, 2009 05:01PM

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.