SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Rank
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

sqlakm1
Starting Member

9 Posts

Posted - 03/01/2013 :  00:47:04  Show Profile  Reply with Quote
Dear Experts,

I have a sample data in table where data is like as per the attached screen. I want to take Rank as per the last column.



Please help me how to do this.

regards,
AKM

visakh16
Very Important crosS Applying yaK Herder

India
52325 Posts

Posted - 03/01/2013 :  01:16:24  Show Profile  Reply with Quote

SELECT DENSE_RANK() OVER (PARTITION BY [Date],Name ORDER BY ID) AS rank,ID,[Sr.no],Name,[Date]
FROM table


------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

sqlakm1
Starting Member

9 Posts

Posted - 03/01/2013 :  03:32:55  Show Profile  Reply with Quote
Thanks
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

India
52325 Posts

Posted - 03/01/2013 :  03:34:40  Show Profile  Reply with Quote
wc

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.05 seconds. Powered By: Snitz Forums 2000