Re: How to find second maximum salary
Posted By:
Sriram_Kanala
Posted On:
Friday, July 9, 2004 11:18 PM
SELECT * FROM EMPLOYEES E1 WHERE 2 = (SELECT COUNT(*) FROM EMPLOYEES E2 WHERE E1.SALARY <= E2.SALARY)
Re: How to find second maximum salary
Posted By:
Christopher_Koenigsberg
Posted On:
Wednesday, July 7, 2004 01:14 PM
somehow I think you are only going to be getting a minimum salary, if you are so incapable of learning simple SQL yourself... :-)
Re: How to find second maximum salary
Posted By:
Simon_Ablett
Posted On:
Wednesday, July 7, 2004 05:51 AM
The easiest although not necessarily the most efficient approach would be to use something akin to 'SELECT Salary FROM MyTable ORDER BY Salary DESC' and then interate through the resultset noting the first value and then finding the first instance that's not equal to it.
Regards.