dotnetspider.com
Login Login    Register      

TutorialsForumCareer DevelopmentResourcesReviewsJobsInterviewCommunitiesProjectsTraining

Subscribe to Subscribers
Talk to Webmaster
Tony John

Facebook
Google+
Twitter
LinkedIn
Online MembersGuru Shabari Nathan B
Vinod
srirama
ashwini gawade
Prasad kulkarni
sini
sanjayworkpoint
More...
Join our online Google+ community for Bloggers, Content Writers and Webmasters




Resources » Code Snippets » SQL

Ranking Functions in SQL Server 2005


Posted Date:     Category: SQL    
Author: Member Level: Gold    Points: 3


Ranking Functions in SQL Server 2005



 


Ranking functions are introduced in sql server 2005.Ranking functions are used to creating arrays, generating sequential numbers, finding ranks, and so on,which in pre 2005 versions require more lines of code ,now can be implemented easier and faster.
Let's look at the syntax of ranking functions

ROW_NUMBER () OVER ([] )
RANK () OVER ([] )
DENSE_RANK () OVER ([] )
NTILE (integer_expression) OVER ([] )


Try the following code to get Row Number:-

SELECT ROW_NUMBER() OVER (ORDER BY FieldName ASC) AS ROWNO, * FROM Table_Name
Related Resources:


Read related articles: SQL Ranking function    SQL functions    SQL Server 2005    


Did you like this resource? Share it with your friends and show your love!


Responses to "Ranking Functions in SQL Server 2005"

No responses found. Be the first to respond...

Feedbacks      

Post Comment:




  • Do not include your name, "with regards" etc in the comment. Write detailed comment, relevant to the topic.
  • No HTML formatting and links to other web sites are allowed.
  • This is a strictly moderated site. Absolutely no spam allowed.
  • Name:   Sign In to fill automatically.
    Email: (Will not be published, but required to validate comment)



    Type the numbers and letters shown on the left.


    Next Resource: How to Retrieve Data From More Than One Row into columns?
    Previous Resource: How to get Row Number with the result of SQL select query
    Return to Resources
    Post New Resource
    Category: SQL


    Post resources and earn money!
     
    More Resources
    Popular Tags   Tag posting guidelines   Search Tags  
    Ranking Functions in SQL Server 2005  .  



    Follow us on Twitter: https://twitter.com/dotnetspider

    Active Members
    TodayLast 7 Daysmore...

    Awards & Gifts
    Email subscription
  • .NET Jobs
  • .NET Articles
  • .NET Forums
  • Articles Rss Feeds
    Forum Rss Feeds


    About Us    Contact Us    Copyright    Privacy Policy    Terms Of Use    Revenue Sharing sites   Advertise   Talk to Tony John
    Copyright © SpiderWorks Technologies Pvt Ltd., Kochi, India
    2005 - 2012 All Rights Reserved.
    .NET and other trademarks mentioned in this site belong to Microsoft and other respective trademark owners.
    Articles, tutorials and all other content offered here is for educational purpose only.
    We are not associated with Microsoft or its partners.