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

Answer Posted / raaghav

Try this query
===================
SELECT TOP 1 salary
FROM (
SELECT DISTINCT TOP n salary
FROM employee
ORDER BY salary DESC) a
ORDER BY salary
where n > 1 '(n is always greater than one)

E.g.:-
SELECT TOP 1 salary
FROM (
SELECT DISTINCT TOP 6 salary
FROM employee
ORDER BY salary DESC) a
ORDER BY salary

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

notice the distinction between data driven testing and retesting?

487


I am surekha new commer for this site? I have some doubt's pls clarify it..... I finished my B.tech and S/w Testing Course Now iam searching for a job in Testing, I did not have any experience in real time projects. Any body can send me the sample Testcases,Srs,Matrix for Banking,ERP Projects etc.Here is my email id surekhai@yahoo.com

3835


What are different coverages in function testing?

610


How automation process is carried out?

566


Tell us can we find all links on a web page?

564






how to map requirements& test cases in quality center ???

2063


Tell me how can we find the value of different attributes like name, class, value of an element?

596


Tell us how could you explain the main difference between webdriver and rc?

568


I want a code for a following item in TSL Language. Look up a person in database, If not found, add person to the database.

1445


Do you know what is a xpath?

549


How to decide the tool that one should use for automation testing in their projects?

571


HOW CAN WINRUNNER AND TEST DIRECTOR CONNECTED TO THE DATABASE AND WHAT R THE OPTIONS?

1466


Tell me how a text written in a text field could be cleared?

525


What are the frameworks available in rc?

586


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

1124