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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T17:34:46+00:00 2026-06-17T17:34:46+00:00

this my table student_numbers ROLL_NO NAME CLASS HINDI MATHS SCIENCE 2 amit 11 91

  • 0

this my table

student_numbers

ROLL_NO NAME    CLASS   HINDI   MATHS   SCIENCE
2   amit    11  91  91  81
3   anirudh 11  88  87  81
4   akash   11  82  81  85
5   pratik  10  81  99  98
7   rekha   10  79  97  82
6   neha    10  89  91  90
8   kamal   10  66  68  69
1   ankit   11  97  98  87

i want to add last three columns and rank on that total partitioned by class

this is what i tried

select roll_no,name,class,total,
rank() over (partition by class order by total desc) as rank
from student_numbers,(select hindi+maths+science total from student_numbers)
;

but this is showing a very large table,with duplicate student name having different total .

  • 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-17T17:34:47+00:00Added an answer on June 17, 2026 at 5:34 pm

    I’m not exactly sure what you are trying to accomplish — order the highest grades by class? If so, something like this should work:

    SELECT SN.Roll_No, 
       SN.Class, 
       SN2.Total, 
       RANK() OVER (PARTITION BY SN.Class ORDER BY SN2.Total DESC) as rank
    FROM Student_Numbers SN
    JOIN (
    SELECT
       Roll_no, hindi+maths+science as Total
    FROM Student_Numbers
    ) SN2 ON SN.Roll_No = SN2.Roll_No
    

    Here is the SQL Fiddle.

    Good luck.

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

Sidebar

Related Questions

I have two tables associated by FK. Table student is mapped like this: @Entity
I have a table that looks like this for about ~30 students: StudentID Course*
this table i want to create job_id dynamic Jobs Title text Job Description text
This table is used to store sessions (events): CREATE TABLE session ( id int(11)
In this table how would I use YQL/Xpath to get all data members of
Got this: Table a ID RelatedBs 1 NULL 2 NULL Table b AID ID
Consider this table on SQL Server wordID aliasID value =========================== 0 0 'cat' 1
With this table: CREATE TABLE test_insert ( col1 INT, col2 VARCHAR(10), col3 DATE )
Take this table WORDS WORD Hello Aardvark Potato Dog Cat And this list: ('Hello',
I am a student this is homework... I have one table with four columns:

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.