![]() Otherwise, no need to calculate rank based on the Hid.Ĭan you give some sample data to illustrate this. Thanks visak I have to use Hid only when the rank is in tie. For example, if the hierarchy id is 1 then the rank should be high, if the hierarchy is 2 then the rank should be lesser So, if tie is happened then i need to calcualate the rank based on the Hierarchy. The rank its showing currently is Value Rank582 43534 316707 1162But i have Hierarchy id in another table. ![]() Show your current sample data and rank you expect it to get look for syntax and usage in books online.Īs per my understanding the Row_Number and Partition will reset the continous rank.How it will help in this scenario? Then what you want is ROW_NUMBER() with PARTITION BY. If two persons salary is equal then i need to do the rank based on the another field HierarchyID(like 1,2,3 in my requirement). if you want to use continuos ranks use DENSE_RANKįor example I am doing rank for Salary. ![]() can you explain? do you want to give them seperate rank. I want to know, how to break the tie in SQL server 2005.If anybody knows, please replyĭidnt get that. How to break a tie using Rank() function in SQL We've got lots of great SQL ServerĮxperts to answer whatever question you can come up with.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |