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
What is primary and foreign key?
List the different type of joins?
What is the difference between mdf and ndf files?
What is the difference between a subquery and a join?
What is thread join () in threading?
What is record type in pl sql?
write an sql query to get third maximum salary of an employee from a table named employee_table. : Sql dba
what are the security recommendations while using mysql? : Sql dba
What is db journal file?
What is dml with example?
What is dba in sql? : SQL DBA
Explain the purpose of %type and %rowtype data types with the example?
what is the difference between char and varchar data types? : Sql dba
what is a trigger in mysql? Define different types of trigger. : Sql dba
What is the difference between sql, mysql and sql server?