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 ?    5 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is query optimization in sql?

550


what does it mean to have quoted_identifier on? : Sql dba

679


What are different types of triggers?

564


What is sql injection vulnerability?

494


what is cursor. write example of it. What are the attributes of cursor.

747






What are all the different normalizations?

591


What is sqlca in powerbuilder?

572


What is left inner join in sql?

519


How to select unique records from a table?

571


What is fmtonly in sql?

534


what is subquery? : Sql dba

573


How does pl sql work?

528


Explain the the update statement in sql?

573


How can I see all tables in sql?

548


Why is normalization important?

541