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 / prativa mishra
select *
from
(select salary,dense_rank() over (order by salary) kk from table_name)
where kk=2
| Is This Answer Correct ? | 7 Yes | 2 No |
Post New Answer View All Answers
What is rank function in sql?
What is natural join in sql?
what is an execution plan? When would you use it? How would you view the execution plan? : Sql dba
Why is nosql good?
What will you get by the cursor attribute sql%notfound?
Explain constraints in sql?
How subquery works in sql?
Explain the working of foreign key?
What is primary key and foreign key with example?
What is function and procedure in pl sql?
If a cursor is open, how can we find in a pl/sql block?
What are procedures used for?
Does sql profiler affect performance?
What is the difference between between and in condition operators?
What is the difference between alter trigger and drop trigger statements?