I’m confused about the differences between these. Running the following SQL gets me two idential result sets. Can someone please explain the differences?

SELECT ID, [Description], RANK()       OVER(PARTITION BY StyleID ORDER BY ID) as 'Rank'      FROM SubStyle
SELECT ID, [Description], ROW_NUMBER() OVER(PARTITION BY StyleID ORDER BY ID) as 'RowNumber' FROM SubStyle

8 Answers
8

Leave a Reply

Your email address will not be published. Required fields are marked *