July 11, 2022 at 12:00 am
Comments posted to this topic are about the item The Ranking Function
July 11, 2022 at 7:34 am
Can anyone think of any real life examples where you'd want to rank over something non-unique?
July 11, 2022 at 1:38 pm
Can anyone think of any real life examples where you'd want to rank over something non-unique?
Yes. Sales by salesman, salary. I once had a query that ranked truck drivers by many categories individually - miles driven, loads, total revenue, revenue per mile, etc.
July 11, 2022 at 3:18 pm
Can anyone think of any real life examples where you'd want to rank over something non-unique?
Sure, this is pretty common when you use it with a meaningful order by. A common example might be something like top sales rep per day, partition by day and order by number of sales.
July 11, 2022 at 10:53 pm
Can anyone think of any real life examples where you'd want to rank over something non-unique?
Heh... along with what the others posted, another possible answer is "Interview Question" 😉
--Jeff Moden
Change is inevitable... Change for the better is not.
July 11, 2022 at 10:54 pm
Great question, Steve.
Another hint here is that there's nothing to guarantee the order within any given rank.
--Jeff Moden
Change is inevitable... Change for the better is not.
July 12, 2022 at 1:45 am
Of course, changing the function to DENSE_RANK() and the answer changes to "2 - Lenovo & Samsung".
Viewing 7 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply