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
What are the 5 common software development problems solutions?
Why automation testing?
What is the difference between close and quit command?
Once you identify the tool what would be your next steps?
How do you select which automation tool is best suited for you?
Why do you prefer selenium automation tool?
Explain what is a relative xpath?
Tell us what is the difference between getwindowhandles() and getwindowhandle()?
Do you know how to check if a button is enabled on the page?
Tell us how could you explain the main difference between webdriver and rc?
What is a framework for automation testing?
Give some examples for performance test tools?
Hi everyone, Are you looking for "worksoft certify" automation tool training online? We have experienced corporate Worksoft certify trainers. We also provide support Worksoft certify automation issues. Please contact us Automationsolutions@yahoo.com
Do you know what is the purpose of creating a reference variable- 'driver' of type webdriver instead of directly creating a firefoxdriver object or any other driver's reference in the statement webdriver driver = new firefoxdriver();?
Is automation testing a black box testing or white-box testing?