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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T11:55:41+00:00 2026-06-17T11:55:41+00:00

I Have a marksheet table like: ID STUDENT_ID Branch_id Class_id Exam_id Subject_id Numbers Date

  • 0

I Have a marksheet table like:

ID  STUDENT_ID  Branch_id   Class_id    Exam_id Subject_id  Numbers     Date
1       653         5           1           1   8               60      2012-01-01
2       653         5           1           1   9               40      2012-01-01
3       653         5           1           1   10              80      2012-01-01
4       653         5           1           1   11              50      2012-01-01
5       653         5           1           1   12              65      2012-01-01
6       653         5           1           1   13              33      2012-01-01
7       653         5           1           1   15              86      2012-01-01
8       222         5           1           1   8               100     2012-01-01
9       222         5           1           1   9               80      2012-01-01
10      222         5           1           1   10              92      2012-01-01
11      222         5           1           1   11              50      2012-01-01
12      222         5           1           1   12              65      2012-01-01
13      222         5           1           1   13              33      2012-01-01
7       222         5           1           1   15              86      2012-01-01

I need to know the rank of student if one or more student equal in rank. and filter with branc and class id.

Can any one help me?

  • 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-17T11:55:42+00:00Added an answer on June 17, 2026 at 11:55 am

    Try this:

    SELECT STUDENT_ID, Numbers, IF(@marks=(@marks:=Numbers), @auto, @auto:=@auto+1) rank 
    FROM (SELECT STUDENT_ID, Branch_id, Class_id, SUM(Numbers) Numbers
          FROM quiz_user 
          GROUP BY STUDENT_ID 
          ORDER BY Numbers DESC, STUDENT_ID 
         ) AS A, (SELECT @auto:=0, @marks:=0) AS B
    WHERE Branch_id = 5 AND Class_id = 1; 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Have a procedure which looks like Procedure TestProc(TVar1, TVar2 : variant); Begin TVar1 :=
have 2 questions : A computer with 32-bit address uses 2-level page table (9
Have to set expiry date for my app. At present, I am storing the
Have a linking (or ref) table which has a dual primary key. Need to
Have a look at the year after setWeek d = Date.today() Wed Dec 26
have a class structure like so Permit -> Financial ->ICollection instrumentList Instrument -> Agency
Have a MySQL database table with 2 columns: id, url The url column has
Have been trying for hours - unfortunately I'm stuck on this three-table join. The
Have a look at the menu link Produkter on http://marckmann.se/ I would like to
Have found maven to use hard for simple things like jar-signing ..May be I

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.