I have a table Student with fields: Student_id
, Student_Name
, Mark
, Branch
.
I want to get the nth highest mark and name of each branch with in a single query. Is it possible?
for Example if the datas are
S1 | Amir | EC | 121
S2 | Ewe | EC | 123
S3 | Haye | EC | 45
S4 | Mark | EC | 145
S5 | Tom | CS | 152
S6 | Hudd | CS | 218
S7 | Ken | CS | 48
S8 | Ben | CS | 15
S9 | Wode | CS | 123
S10 | Kayle | IT | 125
S11 | Den | IT | 120
S12 | Noy | IT | 126
And I am selecting to display the third highest mark in each branch the output should be like
S1 | Amir | EC | 121
S9 | Wode | CS | 123
S11 | Den | IT | 120