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 issues come up in test automation, and how do you manage them?
Is automation testing a black box testing or white-box testing?
What is keyword driven automation?
Tell us what is the difference between getwindowhandles() and getwindowhandle()?
Tell us how do you get the width of the textbox?
hi to all, if we open a browser(for ex. yahoomail.com) using navigate command. the cursor by default focussing on the 'yahoo id' html edit box. how to get the label(ie.,yahoo id) of that html edit box using descriptive program. here we should not use identify tool to get the property,thtml editbox method. by tracing the cursor position we have to get the label name. is it possible? please let me know.
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.
Tell us what is junit? And what is junit annotation?
Generic function for selecting a Radio Button in a Dialog
Tell me what is tsl? What 4gl is it similar too?
When is automation testing useful?
Can you achieve 100% automation?
What is meant by the automation framework?
write a programme to insert into elements in array?n finding duplicate characters in given sting?
Tell us how to select a value in a dropdown?