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 are different types of triggers?
How do rank () and dense_rank () differ?
What do you mean by field in sql?
What is oracle and pl sql?
What is row_number () in sql?
What is consistency?
Explain the insert into statements in sql?
What is scalar function in sql?
what are the different tables present in mysql? : Sql dba
Table A Table B 1 1 2 1 3 1. Union & union all --> A Union B , A Union all B 2. Minus , Intersect --> A minus B , B Minus A , A Intersect B 3. Joins A join B , A Left Join B A Right Join B , A full Join B 4. %Type - Uses & Benifit 5. Truncate & Delete 6. Pragma Autonomus Transaction 7. how to Perform DDL from function or procedure 8. Can we have DML inside Function 9. Rank & Dense Rank diffrence 10. Water Mark in Oracle 11. Index , Can we have index in all column of table if no then why ?
How do I get sql certification?
What is sql performance tuning?
What is sql integrity?
how can we encrypt and decrypt a data present in a mysql table using mysql? : Sql dba
what is normalization? : Sql dba