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
Legend of ...
(94)
D.Jeya kumar(J...
(57)
Athira Appukut...
(45)
Last 7 Days
Athira Appukut...
(1465)
Sridhar R
(1336)
UltimateRengan
(1221)
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
Delete Duplicate Records
Find highest salary among two tables
GRANT permission to ALL stored procedures
How to use group by in SQL Server
How to use stored procedure to take large Text input and populate in a table
dotNet Slackers
BizTalk Adaptors
Web Design
doors in nj
Contact Us
Privacy Policy
Terms Of Use