Then encircled rows in the Rank / Dense_Rank examples below have ties for TotCnt. Ex1 (using Rank()) has ties for TotCnt=19 and TotCnt=20. Then TopCustomers rank jumps from 4 to 6. In Ex2 (using Dense_Rank() for same set) has the same ties but the TopCustomers rank goes smoothly from 4 to 5 and so on incrementing by 1. Why is this? What is different from Rank() vs Dense_Rank()?
Use Northwind
SELECT RANK() OVER (ORDER BY TotCnt DESC) AS TopCustomers, CustomerID, TotCnt
FROM (SELECT CustomerID, COUNT(*) AS TotCnt
FROM Orders Group BY CustomerID) AS Cust
-------------------------------------------
SELECT DENSE_RANK() OVER (ORDER BY TotCnt DESC) AS TopCustomers, CustomerID, TotCnt
FROM (SELECT CustomerID, COUNT(*) AS TotCnt
FROM Orders Group BY CustomerID) AS Cust