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
Can we call procedure in select statement?
Which sql most popular?
How does cross join work?
What is dense_rank in sql?
What is t sql used for?
How do you add a column to a table?
How do I view tables in mysql?
What is cursor in pl sql?
What is the difference between a subquery and a join?
Is grant a ddl statement?
What is the difference between explicit and implicit cursors in oracle?
Show code of a cursor for loop.
how does a local variable is defined using t-sql? : Transact sql
What are the string functions in sql?
How can we find duplicate records in a table?