how to find the second highest salary from emp table?
Answer Posted / nalini
Follow the following Query, You get the second highest
salary.
SQL> Select level,Max(sal) from emp
Where level=&level connect by prior sal>sal
group by level;
SQL> Enter the level No=2 (Here enter 2 manually)
Then you will get the 2nd highest salary.
If you want 3rd Highest salary, then enter level no=3.
| Is This Answer Correct ? | 208 Yes | 105 No |
Post New Answer View All Answers
Explain the rollback statement?
what are the limitations of identity column? : Transact sql
How to Execute a Package in PL/SQL.?
Can a table contain multiple foreign key’s?
How can I tell if sql is running?
Can one improve the performance of sql*loader? : aql loader
Does sql profiler affect performance?
How to create an array in pl/sql?
What is sql indexing?
What is difference between primary and secondary key?
Explain two easy sql optimizations.
How do I view a sql trace file?
What is the purpose of the sql select top clause?
Explain ddl statements in pl/sql?
Can a trigger call a stored procedure?