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 primary and foreign key?

585


List the different type of joins?

564


What is the difference between mdf and ndf files?

557


What is the difference between a subquery and a join?

520


What is thread join () in threading?

534






What is record type in pl sql?

533


write an sql query to get third maximum salary of an employee from a table named employee_table. : Sql dba

535


what are the security recommendations while using mysql? : Sql dba

568


What is db journal file?

513


What is dml with example?

509


What is dba in sql? : SQL DBA

525


Explain the purpose of %type and %rowtype data types with the example?

544


what is the difference between char and varchar data types? : Sql dba

528


what is a trigger in mysql? Define different types of trigger. : Sql dba

543


What is the difference between sql, mysql and sql server?

524