Jared Westover explains the difference:
Recently, a developer asked for my input on solving a complex SQL query problem. As we went through each step, I suggested using a ranking function at one point, specifically RANK. However, they were having trouble deciding when to use RANK versus DENSE_RANK in a query. It raises a good question: When should you use DENSE_RANK instead of RANK?
Jared’s analogies for when to use which are very similar to the ones I use: a race versus levels.
Leave a Comment