MySQL Forums
Forum List  »  Newbie

Re: MySQL ranking query based on multiple columns
Posted by: Darin Hawley
Date: January 31, 2018 09:15PM

Peter Brawley Wrote:
-------------------------------------------------------
> > The 'high_score' field is in the table to begin
> with and is always set to '1'
> > for the row where a user's score is the highest
> for them for that quiz.
>
> The highest for "them"? Who are "them"?
>

Them being the user, the high_score field is 1 for the row of the user that contains their highest score for a quiz.

> > a SQL query that I can run on an individual user
> to pull their highest score
> > from each of the two quizzes ('math' and
> 'reading') along with their overall
> > rank among scores for that quiz. What I have so
> far is the following:
>
> You want for each user (i) her highest math and
> reading scores, (ii) her overall rank on all
> scores on all tests irrespective of subject?
>
I want for each user their highest math score, along with its rank among all math scores, similarly their highest reading score and its rank among the reading scores. I do not need rank among all scores together, only rank among the scores for the quiz that score came from.

Options: ReplyQuote


Subject
Written By
Posted
Re: MySQL ranking query based on multiple columns
January 31, 2018 09:15PM


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.