Click here to Skip to main content
11,935,361 members (61,921 online)
Click here to Skip to main content
Add your own
alternative version


3 bookmarked

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)


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


About the Author

India India
No Biography provided

You may also be interested in...

Comments and Discussions

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

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    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
Web04 | 2.8.151126.1 | Last Updated 16 Feb 2011
Article Copyright 2011 by Mohd_Ahmad
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid