Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 ranking

Author  Topic 

banzegirl2
Starting Member

1 Post

Posted - 2008-02-14 : 02:45:44
Hi guys
I'm trying to figure out how to rank records. From the highest value to the lowest. Can you please help?

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2008-02-14 : 02:48:21
if you are using SQL 2005 you can make use of row_number() or rank() etc


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-02-14 : 03:16:24
you have three functions to achieve this in SQL 2005 row_number(),dense_rank() and rank(). look in BOL for syntax.
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2008-02-14 : 03:59:56
Also refer
http://sqlblogcasts.com/blogs/madhivanan/archive/2007/08/27/multipurpose-row-number-function.aspx

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -