Click here to Skip to main content
Click here to Skip to main content

Tagged as

nth Highest Salary in SQL Server 2005

, 16 Feb 2011 CPOL
Rate this:
Please Sign up or sign in to vote.
SELECT salary FROM TN a 
    WHERE n - 1 = (SELECT COUNT(salary) FROM TN b WHERE b.salary > a.salary)

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

Mohd_Ahmad

India India
No Biography provided

Comments and Discussions

 
GeneralRe: Looks like you have not modified your vote yet. There is sti... PinprotectorAspDotNetDev22-Feb-11 15:44 
GeneralRe: You're right :) *ashamed* I'll modify my vote. Pinmemberphil.o22-Feb-11 9:17 
GeneralReason for my vote of 1 There are some issues with your quer... PinmemberCostica U2-Mar-11 14:55 
GeneralReason for my vote of 1 First, the SQL request you give seem... Pinmemberphil.o17-Feb-11 6:46 
GeneralRe: I think you are being a little hard here. The Subject says ... PinmemberHenry Minute17-Feb-11 15:41 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.1411022.1 | Last Updated 16 Feb 2011
Article Copyright 2011 by Mohd_Ahmad
Everything else Copyright © CodeProject, 1999-2014
Layout: fixed | fluid