Difference between Row_number() and dense_rank()

Difference between Row_number() and dense_rank():

Row_number():
It is used to select the records.


Dense_rank():

It is used to select the distinct records.

Rank(): Rank will also select the distinct records. But difference with dense_rank() is it will give the rank to 5 if it starts from second row and continuous three records are same, then it will assign the next row rank as 6. Instead of third record.

Leave a Reply