Find the second highest value in SQL

0
69
MySQL

Here is the example that explains how to find the second highest value from the table in MySQL.

SNNameMarks
1John80
2Sam85
3Jinni92
4Smith95
SELECT name, MAX(marks) AS marks
  FROM exam_report
 WHERE marks < (SELECT MAX(marks)
                 FROM exam_report); 

Result:

NameMarks
Jinni 92

LEAVE A REPLY

Please enter your comment!
Please enter your name here