Write a query to find second highest salary of an employee.
Answer Posted / ashish
select salary from
(select dense_rank() over(order by salary desc) as highest, salary from employee)as y
where highest=2
: replace 2 with n.... it will give nth highest salary
: rank() will work correctly only if all the salaries in employee table are distinct.
: dense_rank() will work correctly, does'nt matter salaries are distinct or NOT.
Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
What is the difference between automation tools and management tools?
Tell me how can the user get a text of a web element?
What are the types of framework used in software automation testing ?
What are the points that are covered while planning phase of automation ?
Can you list some other automation testing tools that you are familiar with?
Explain about basics of rational robot - ibm test automation tool?
What are pros and cons of automating tests at ui layer?
Do you know what is a data-driven framework?
What are the main differences between Loadrunner and QTP tools? Describe briefly a "real world" scenario that would make you use the first one versus the other? Thank you for your answers....
Tell me what is the firefoxdriver, class or an interface? And which interface does it implement?
In general, how do you see automation fitting into the overall process of testing?
Tell us how to select a value in a dropdown?
Do you know how can we make one test method dependent on other using testng?
List some advantages and disadvantages of manual testing.
Stop automating the tests which run once?