Use of Dense_Rank() function in SQL Server

No.of Views1049
Bookmarked1 times
Downloads 
Votes0
By  youngmurukan   On  15 Feb 2010 21:02:15
Tag : Sql Servers , T-SQL
Use of Dense_Rank() function in SQL Server
emailbookmarkadd commentsprint

Images in this article missing? We recently lost them in a site migration. We're working to restore these as you read this. Should you need an image in an emergency, please contact us at info@codegain.com

 SELECT Dense_Rank() OVER (ORDER BY receiptdate ) as Firt_Arrival,locationnumber,receiptdate
FROM inventorylocsubdetail





Here Dense_Rank() fn would return the rank based on the ReceiptDate. But this would be in sequence even if there are same rank more than one. (This is the major different between Rank() and Dense_Rank())


E.g: here rank 4 repeating for three records,though next rank is 5 (4,4,4,5)

 
Sign Up to vote for this article
 
About Author
 
youngmurukan
Occupation-Not Provided
Company-Not Provided
Member Type-Senior
Location-Not Provided
Joined date-12 May 2009
Home Page-Not Provided
Blog Page-Not Provided
 
 
Other popularSectionarticles
Comments
There is no comments for this articles.
Leave a Reply
Title:
Display Name:
Email:
(not display in page for the security purphase)
Website:
Message:
Please refresh your screen using Ctrl+F5
If you can't read this number refresh your screen
Please input the anti-spam code that you can read in the image.
^ Scroll to Top