Tutorials
Resources
Forum
Interview
Jobs
Projects
Offshore Development
Mentor
|
Code Converter
|
Articles
|
Code Factory
|
Computer Jokes
|
Members
|
Peer Appraisal
|
IT Companies
|
Bookmarks
|
Revenue Sharing
|
Talk to Us
|
My Profile
Sign In
Register
AdSense Revenue
Gifts
Active Members
Today
UltimateRengan
(27)
Athira Appukut...
(26)
varun
(21)
Last 7 Days
D.Jeya kumar(J...
(739)
UltimateRengan
(731)
Athira Appukut...
(590)
more...
SQL Query to Find the Nth highest Colum Value in a Table.
Posted Date: 23 Jul 2008 Resource Type:
Code Snippets
Category:
SQL
Posted By:
saji
Member Level:
Gold
Rating:
Points
: 2
Let us assume that we have Table with Student Name and Mark. From this table
we have to find out Nth Highest Mark.
SELECT TOP 1 Mark FROM (SELECT TOP {N} Mark FROM Student ORDER BY Mark DESC)
AS E ORDER BY Mark ASC
Where {N}= 2,3,4,5 etc
Eg: For 4th Highest Mark {N}=4
Responses
Author:
mani kumar.k.m
25 Jul 2008
Member Level:
Gold
Points
: 1
Hi saji,
nice example.
its query very useful to lots of guys.
Thanks for sharing your knowledge with us.
thanks & regards
Feedbacks
Popular Tags
What are tags ?
Search Tags
Sign In
Sql
.
Query
.
Post Feedback
This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must
Sign In
to post a response.
Next Resource:
how to select last inserted record in sqlserver2005
Previous Resource:
Creating Triggers
Return to Discussion Resource Index
Post New Resource
Category:
SQL
Post resources and
earn money
!
Related Resources
Passing Data from one sp to other sp using Temp Table.
PIVOT Operator in SQL Server 2005
How to use COALESCE() in role
Save image file into SQL Server without using Stored Proc
Find Difference between two dates in T-SQL
dotNet Slackers
BizTalk Adaptors
Web Design
doors in nj
Contact Us
Privacy Policy
Terms Of Use