Tuesday 27 December 2011

Rank vs Dense_Rank


  1. Rank(), Dense_Rank() are OLAP Functions
  2. They are used to find ranks for a table based on certain business logic.
  3. Syntaxes:
    1. Rank() over ( expr );
    2. Dense-Rank() over ( expr );
  4. The difference between rank and dense rank is that,


    Rank : Generate gap when there are same ranks.

    Dense_Rank: Doesn't generate a gap when there are same ranks.
  5. These functions must not be used in where clause.


1 comment:

  1. Shashikanth, you are awesome! Nice post, and a good one here too:

    dense_rank and rank functions

    ReplyDelete