Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4543556
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T15:32:52+00:00 2026-05-21T15:32:52+00:00

I have a table with scores that contestants get after the complete a quiz.

  • 0

I have a table with scores that contestants get after the complete a quiz. I then select the max(points) for each user and i group by user

select distinct userName, max(points) as numpoints
from tblscore
group by userName 
order by numpoints desc

this gives me the order of all the highest scores for the user. i want to store these records in an array and process it, i want to rank each record plus i want to display records where the users have a tie. How can this be achieved? how will the array be set up and processed to cater for this.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T15:32:53+00:00Added an answer on May 21, 2026 at 3:32 pm
    1. Create a class (e.g. UserScore) with two fields – username and points
    2. Get the ResultSet for the desired query (via a Statement)
    3. Define a List<UserScore> list = new ArrayList<UserScore>
    4. Loop the result set, using while (rs.next()) and on each iteration create a new instance of the UserScore class, set both of its fields (e.g. userScore.setPoints(rs.getInt("numpoints")), and then add the object to the list
    5. If you can do with a List – go with it. If you really need an array – use list.toArray(..)

    Alternatively, you can use apache commons-dbutils, and after you create the UserScore class, you just call:

    List<UserScore> list = new BeanListHandler(UserScore.class).handle(resultSet);
    

    Note that in this case your fields should be called the same way as your returned column names/aliases. You can also use the ArrayListHandler, which, instead of a list of the defined class, will give you a List<Object[]> where each column will be an element in the array.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Let's say that I have a 'Scores' table with fields 'User' , 'ScoreA' ,
I have a table that stores user information. The table has a userid (identity)
I have a table scores(user, score) and I have this query SET @row_num =
I have a MySQL high scores table for a game that shows the daily
i have this table for a game scores (user,score) with some entries in it,
Hi Guys I have One table that Stores Student Scores for Different Subjects in
We have a table that converts SAT scores into ACT scores using a year.
Gday, I have a table that shows a series of scores and datetimes those
I have a table that stores scores from users of my game - what
I have the following table: scores: user_id | match_id | points 1 | 110

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.