+ 1

How to find second highest salary from a table?

2nd Sep 2016, 2:22 PM
Kirtiranjan Sahoo
Kirtiranjan Sahoo - avatar
2 Respuestas
+ 1
select all records, order by salary DESC and limit 2. then you can get the second record of the table using the programming language that you are using
2nd Sep 2016, 4:51 PM
Luis Arce
Luis Arce - avatar
0
select *from table t1 where 1=(select count(*) from table t2 where t2.sal>t1.max(sal))
3rd Sep 2016, 7:45 AM
Pujari Sruthi
Pujari Sruthi - avatar