This post shows the difference between RANK and DENSE_RANK.
Select DeptNo , Sal , RANK() OVER (Partition By DeptNo Order By Sal ) Rank , DENSE_RANK() OVER (Partition By DeptNo Order By Sal ) Dense From Emp Where DeptNo <> 20 Order By DeptNo, Rank;

Here you can see that RANK leaves a gap after a tie and DENSE_RANK does not.

0 comments:
Post a Comment