how to find the second highest salary from emp table?
Answer Posted / manikishore
select * from emp e where
2 =(select count(distinct sal) from emp where e.sal<=sal);
//if you want to retrieve 3rd max(sal) then you can use 3 in place of 2,,,like that for so on..
| Is This Answer Correct ? | 1 Yes | 1 No |
Post New Answer View All Answers
What is pl sql collection?
what is the difference between delete and truncate commands? : Sql dba
How to run sql functions in pl/sql?
The in operator may be used if you know the exact value you want to return for at least one of the columns.
Does truncate table reset auto increment?
What is an ndf file?
What trigger means?
what are different types of keys in sql?
What is the execution plan in sql?
Can we join tables without foreign key?
Does oracle roll back the transaction on an error?
Differentiate between sga and pga.
What is left join example?
Does inner join return duplicate rows?
Can we use commit inside a trigger?