.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Forum >> Sql Server >> Post New QuestionBookmark and Share Subscribe to Forum

what is the difference between rank and dense rank?

Posted By: Deco     Posted Date: September 13, 2010    Points:2   Category :Sql Server
please give me exact difference of the above?

Responses
Author: Syed Shakeer Hussain             
Posted Date: September 14, 2010     Points: 5   

Hi,
Rank():- Rank() doesnot assign Uniwue Numbers.

DenseRank():- DenseRank() like Rank() doesnot assign Unique Number,but it does assign contiguous numbers

check this link for more information with good Example
http://www.sqlservercurry.com/2009/04/rank-vs-denserank-with-example-using.html

Author: Akhil Raj       [Moderator]      
Posted Date: September 18, 2010     Points: 5   

The RANK()function in SQL Server returns the position of a value within the partition of a result set, with gaps in the ranking where there are ties.

The DENSE_RANK() function in SQL Server returns the position of a value within the partition of a result set, leaving no gaps in the ranking where there are ties.




Post Reply

You must Sign In To post reply
 
 
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more Here
Quick Links For Forum Categories:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  OOPs  SilverlightIISJQuery
JavaScript/VBScriptBiztalkWPFPatten/PracticesWCFOthers
www.DotNetSpark.comUnAnsweredAll

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend