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


Please Help Members By Posting Answers For Below Questions

Can we debug stored procedure?

720


What do you understand by pl/sql packages?

768


What is the difference between functions, procedures, and packages in pl/sql?

705


What is oracle sql developer?

788


What does the sign mean in sql?

704






Is it possible to create startup or shutdown trigger for on-schema?

780


Why do we need cursors in pl sql?

721


Can sql function call stored procedure?

739


What is the difference between mdf and ndf files?

778


Why procedure is used in sql?

754


How delete all records from table in sql?

721


How do you concatenate in sql?

724


Is it possible to sort a column using a column alias?

816


what is a join? : Sql dba

769


How would you convert date into julian date format?

791