Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

What are the 5 common software development problems solutions?

962


Why automation testing?

986


What is the difference between close and quit command?

1008


Once you identify the tool what would be your next steps?

950


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

977


Why do you prefer selenium automation tool?

994


Explain what is a relative xpath?

1011


Tell us what is the difference between getwindowhandles() and getwindowhandle()?

957


Do you know how to check if a button is enabled on the page?

905


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

959


What is a framework for automation testing?

1015


Give some examples for performance test tools?

993


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

1573


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();?

889


Is automation testing a black box testing or white-box testing?

915