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 8277685
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T08:45:19+00:00 2026-06-08T08:45:19+00:00

Student Subj Period Score ————————- A Math 100 50 A Hist 100 100 A

  • 0
Student    Subj   Period  Score
-------------------------
A          Math   100        50
A          Hist   100        100
A          Sci    200        70
B          Math   100        50
B          Hist   100        50

I’m trying to query for the highest score for an each student.

If scores are all same (such as ‘B’ then pick one on the bottom. If that’s not possible, just pick anything.

I’m having a hard time using max() and min() and group by to get a correct result.
Result should look like this

Student    Subj   Period    Score
-------------------------
A          Hist   100       100
B          Hist   100       50
  • 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-06-08T08:45:22+00:00Added an answer on June 8, 2026 at 8:45 am

    You want to use analytic functions (I assume this is in Oracle from the mention of pl/sql):

    select Student, Subj, Period, Score
    from (select t.*,
                 row_number() over (partition by student order by score desc) as seqnum
          from t
         ) t
    where seqnum = 1
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

TABLES: student(name,points) playsin(name->student(name), score) I'm trying to use: UPDATE STUDENT SET points = points
I'm currently a student and I'm studying PHP, I'm trying to make a simple
My student group and I are trying to continue working on a project we
I am a math student, and I'm learning the very basics in programming in
I am a Student..and right now trying to develop code for android..that shows nearby
I'm trying to define a table to store student grades for a online report
Programming Student here...trying to work on a project but I'm stuck. The project is
I'm a college student trying to make a web community with friends. Although we
I am trying to develop a page to display student/class results by subject/teacher. Some
A student in my class brought this to my attention, and I didn't have

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.