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
What is the current version of sql?
In what condition is it good to disable a trigger?
How do I know if I have sql express or standard?
What is difference between pl and sql?
Can procedure in package be overloaded?
How many aggregate functions are available there in sql?
Can we use the cursor's to create the collection in PL/SQL?
what is user defined functions? : Sql dba
Where is pl sql used?
Is it possible to include an insert statement on the same table to which the trigger is assigned?
Can I copy :old and :new pseudo-records in/to an oracle stored procedure?
What is sp_helptext?
Explain lock escalation? : Transact sql
What is having clause in sql?
How many clustered indexes can you have?