Write a query to get 2nd maximum salary in an employee table ?
Answer Posted / ashish jain
select Salary from
(
select salary,ROW_NUMBER() over (order by salary desc) as rownum from Emp group by salary) temp
where rownum=2
Note :It can be used to get any highest salary, just use where rownum=nth salary
Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What is an inner join sql?
what is a constraint? Tell me about its various levels. : Sql dba
How to load data with sql*loader?
Can there be more than one function with a similar name in a pl/sql block?
What is the use of %rowtype?
Explain exception handling in pl/sql?
How many types of indexes are there in sql?
What is rank dense_rank and partition in sql?
What is union, minus and interact commands?
Why procedure is used in sql?
Sql technical questions
Why do we use set serveroutput on?
How many types of privileges are available in sql?
What is difference between ms sql and mysql?
How to return multiple rows from the stored procedure?