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 the use of sql trace?
What is benefit of creating memory optimized table?
How do I run a sql trace?
The select into statement is most often used to create backup copies of tables or for archiving records?
What is dynamic query?
What is sql engine in oracle?
Differentiate between sga and pga.
How do you optimize a stored procedure query?
Explain the purpose of %type and %rowtype data types with the example?
explain the options of myisamchk to improve the performance of a table. : Sql dba
Is it possible to create startup or shutdown trigger for on-schema?
What is user in sql?
What is join view in sql?
What is sql comments?
Which normal form is best?