How to retrieve a second highest salary from a table?
Note:Suppose salaries are in duplicate values
eg:
Name Sal
Malli 60000
Pandi 60000
Rudra 45000
Ravi 45000
Answer Posted / dewesh
With cte as (
Select *, Dense_rank() over (order by salary desc) as s from emp)
Select EmpName, Salary from cte where s =2
It has work. But duplicate value is not removed if name is different
Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
How do you create a unique index?
What is linq to sql?
What is %type in pl sql?
What is spool?
What is the difference between the implicit and explicit cursors?
How does cross join work?
Can we write ddl statements in functions?
What are the ways on commenting in a pl/sql code?
Which is faster subquery or join?
What packages(if any) has oracle provided for use by developers?
Name three sql operations that perform a sort.
what is oracle database ? : Sql dba
what is a view? : Sql dba
What is embedded sql with example?
Explain ttitle and btitle.