15,664,823 members
See more:
i have table- student.which is having fields studentid,studname,mark.i want to get the student name who is having the 3rd highest mark.number of rows are not known,i dont know whether it is required for the calculation,if yes assume any number and give me the answer.thanks in advance
Posted
Updated 22-Feb-21 22:39pm

## Solution 3

Hi ,
Check this also
SQL
```select MAX(marks) from student where marks <
(select MAX(marks) from student where marks <
(select MAX(marks) from student ))```

Best Regards
M.Mitwalli

## Solution 2

Try this:
SQL
```SELECT
TOP 1 marks
FROM
(SELECT DISTINCT TOP 3 marks FROM student ORDER BY marks DESC) a ORDER BY marks```

Or this one
SQL
```WITH Results as
(SELECT Row_Number() over (ORDER BY marks DESC) as RN,* FROM student)
SELECT * FROM student WHERE RN=3```

sravani.v 27-Jun-12 0:08am
My 5! for first query
Thank you Sravani!
sravani.v 27-Jun-12 4:44am
No...searching for another job.
Where?
Rahul Rajat Singh 27-Jun-12 3:01am
Nice. +5.

## Solution 1

How about applying the answers to sql query to find 2nd maximum salary[^]?

## Solution 5

SELECT marks FROM
(
SELECT
marks,
DENSE_RANK()over(order by marks desc)Dn1 FROM student
)as ff where dn1=3;

--this is the best query for finding multiple records exists for same marks.

v2
Richard Deeming 9-Aug-17 11:44am
Santosh kumar Pithani 10-Aug-17 6:00am
Let me know that which solution is best for getting particular rank record?

## Solution 6

Findout the 3rd highest value:

```SELECT mark
FROM employee
GROUP BY mark
ORDER BY mark DESC
LIMIT 2 , 1```

CHill60 21-Jun-19 10:01am
Reasons for my downvote:
- This doesn't even compile
- Even if it did compile it doesn't answer the question
- The question was answered several times 7 years ago
- Doing anyone's homework for them is not helping them

## Solution 7

Try this one

SELECT salary FROM (SELECT DOB FROM Employee ORDER BY DOB DESC) WHERE ROWID = 3

v2