Thursday, April 23, 2015

USING RANK

what do you mean by check values in total income?? you have column total column there right??

if i understand it right, you do another rank for total income..

Rank() over (partition by APPCnum order by total_income desc) as [total income rank]


Hope it Helps!!



That wouldn't quite help as even if they were the same value, rank would still give 1 and 2. Dense_rank would give them both 1 if they were the same but wouldn't help identify if they were the same from a dynamic view. You could either do a lead to read the total_income of the next if that is appropriate or you'd have to pivot them to one row and then compare

No comments:

Post a Comment