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.
Author |
Topic |
thendraljazz
Starting Member
26 Posts |
Posted - 2011-11-09 : 04:15:25
|
I have basic idea about ranking function.but i want to know ranking function with case with example. ThanksThendral |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2011-11-09 : 04:27:49
|
what do you mean by that. Can you show some sample data to illustrate how you want to do case based ranking?------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
thendraljazz
Starting Member
26 Posts |
Posted - 2011-11-09 : 04:31:33
|
Thats ok.I just want to know about ranking functions with example.Can you.. |
 |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2011-11-09 : 04:38:00
|
something like stub below untill i know more on your table,columns and scenarioSELECT RANK() OVER (PARTITION BY somecolumn ORDER BY CASE Somecondition WHEN somevalue THEN somefield WHEN someothervalue THEN someotherfield END ASC) AS Rnk,columns..FROM table ------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
thendraljazz
Starting Member
26 Posts |
Posted - 2011-11-09 : 04:40:18
|
ok.thanks |
 |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2011-11-09 : 04:42:57
|
wc------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
|
|