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
How many types of literals are available in pl sql?
Can we create table in function?
What are the types of subqueries?
What is the difference between stored procedure and view?
What is Difference Between Unique and Primary Key Constraints?
Is it possible to Restore a Dropped Table using Rollback Command in Oracle SQL Plus ?
Why is nosql good?
What is the difference between nvl function, ifnull function, and isnull function?
What is restrict in sql?
Can we connect to postgresql using sql developer?
What do you understand by case manipulation functions?
What is sequence in sql?
What is sql and db2?
List and explain the different types of join clauses supported in ansi-standard sql?
What is offset and limit in sql?