Write a query to find second highest salary of an employee.
Answer Posted / prashant srivastava
**Exact answer to the question**
SELECT MIN(e1.Salary) FROM emp e1 WHERE e1.Salary IN
(Select e2.Salary from emp e2 ORDER BY e2.Salary DESC FETCH
FIRST 2 ROWS ONLY)
**Generic Solution**
SELECT MIN(e1.Salary) FROM emp e1 WHERE e1.Salary IN
(Select e2.Salary from emp e2 ORDER BY e2.Salary DESC FETCH
FIRST n ROWS ONLY)
Just replace n as the asked rank of the salary. For instance
If 29th highest salary is asked then replace n with 29..
simple...isn't it? :):)
Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
Tell me which web driver implementation is the fastest?
Give some examples for test management tools?
How do you identify the test cases which are suitable for automation?
Define sdlc in testing.
hi every one this is ashok pls any one give answer me pls question is while testing with selenium after giving id user name and password , the inbox will be open , how to handle this one
How will you automate basic “login” functionality test cases for an application?
What criteria do you consider for automating a test?
List the five essential types of test steps?
What is build verification testing, bvt?
Tell me what kind of tests should not be automated?
What is meant by the automation framework?
Kindly let me know how to setup JMeter for functionality testing of a Web application.. The apache help doc is good but i m little confused with it... :(
Can any one give me the script for drag and drop or setselection functions ?like in a not pad i want to select 5 lines
Tell me how can we find the value of different attributes like name, class, value of an element?
What are the advantages of the automation framework?