Wednesday, May 18, 2022

Difference between row_number(), rank() and dense_rank()

  
      Row_number() -> Used for generating serial number
                                           it gives unique value to each row
  • RANK() ---->gives  the same row number to the same value, leaving "holes"
  • DENSE_RANK() --->will assign consecutive ranks to the values in the set (so there will be no gaps between the integer ranking values in the case of a tie).

No comments:

Post a Comment

Stored Procedure

  What is a Stored Procedure ? A stored procedure is a prepared SQL code that you can save, so the code can be reused over and over again. S...