Home > Microsoft SQL Server > Select Query

Select Query



ok try this<br><br><br>SELECT MAX(salary) AS Expr1 FROM employee WHERE <br>(salary NOT IN ((SELECT MAX(salary) AS Expr1 FROM employee<br> WHERE (salary NOT IN (SELECT MAX(salary) AS Expr1 FROM employee))),<br> (SELECT MAX(salary) AS Expr1 FROM employee)))<p><hr size="1" width="50%" align="left" />(#_#)</p>

    
Guest


How to get the third highest salary from the employee table.

Was this answer helpful ? Yes No   
Guest


Either with

SET ROWCOUNT 3 OR SELECT TOP 3

SELECT blabla FROM blabla WHERE blabla ORDER BY salary DESC

Then jump to the last line (MoveLast?)

Was this answer helpful ? Yes No   
Guest
 
 
Home - About Infoqu - Contact - Privacy Statement - Link to Infoqu - Bookmark Infoqu

Copyright 2007-2008 by Infoqu. All rights reserved