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
Explain how to use transactions efficiently : transact sql
In a distributed database system, can we execute two queries simultaneously?
what are the authentication modes in sql server? How can it be changed? : Sql dba
What are views in sql?
How many types of normalization are there?
How do I run a sql query?
What is pivot in sql?
What is trigger in sql? Explain
Can %notfound return null after a fetch?
Can we use pl sql in mysql?
What is trigger in pl sql?
What is scalar and vector?
What is partition in sql query?
How do I view stored procedures?
Which join condition can be specified using on clause?