How to find the second largest value from a given coloumn | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

How to find the second largest value from a given coloumn

14th Mar 2019, 8:46 AM
shashikumar lokini
shashikumar lokini - avatar
2 Answers
+ 2
SELECT MAX( col ) FROM table WHERE col < ( SELECT MAX( col ) FROM table ); Check this thread : https://www.sololearn.com/Discuss/1616312/how-to-find-second-highest-salary-of-a-given-table-in-oracle-database
14th Mar 2019, 10:19 AM
Prokopios Poulimenos
Prokopios Poulimenos - avatar
+ 1
SELECT TOP(1) col FROM Table ORDER BY col ASC LIMIT 2
14th Mar 2019, 11:30 AM
Calviղ
Calviղ - avatar