Write a query to find second highest salary of an employee.

Answer Posted / kapil deep

SELECT * FROM (SELECT * FROM emp_t WHERE ROWNUM < 3 ORDER
BY salary) WHERE ROWNUM < 2

above query work fine for oracle.

Taking 3 as N give u 3-1=2 i.e 2nd highest
4-1=3 gives u 3rd highest

Is This Answer Correct ?    0 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why do you want to keep this kind of information in a separate file and not directly in the code?

593


How do you select which automation tool is best suited for you?

530


How the object properties will be recognised by the tool If the functions/ statements are written manually?

1743


What is a ‘test plan’? What is a ‘test case’?

544


wat would be the -ve test case for search where u can brak it ,tell dnt tell abt spl characters insertion ,boundary values chk.

1430






What is data - driven automation?

2112


What is in-house tool?

552


When will you not automate testing?

592


What is test driven development?

609


What steps are needed in developing and running a software test?

540


Explain me what are the main advantages of automation testing?

495


Do you know the difference between close and quit command?

492


how to use regular expression in Test Complete Functional tool

4899


Tell us what is the alternate way to click on login button?

509


How can you create html test report from your test script?

484