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
Can you explain data-driven testing?
How do you identify the test cases which are suitable for automation?
How do we Test the C++ and Unix Application Using Automated Tool.
Explain me what are the main advantages of automation testing?
What are the phases in automation testing life cycle?
Program/pseudo code on FIFO? Input a string and make sure that output is in FIFO manner. Eg, Enter 'John Dave' as input and output should be 'John Dave' not 'Dave John'. (inbuilt functions like push, pop were given)
Hi, I wanted to go with TestingDomain-Automation. Regarding this I need to take training on any one tool either WinRunner or LoadRunner. Which is better to get job,having future and takes lesstime with easier***. pls mention one tool name. Basically iam manual test engineer on unix- platform.
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
Tell me what is tsl? What 4gl is it similar too?
Tell me what are pros and cons of automating tests at ui layer?
Hi all, Do anyone have the experience in PDF Document Automation using OLE objects and methods? If so suggest the best websites for source. Thanks :-)
Explain how to perform load-testing?
Tell me how would you test your own element locator?
Where to maintain information like login, password and url?
What is difference between selenium and QTP tools Which is best tool... Which is most used tool