How to use ROW_NUMBER in sqlserver
1598
26-Nov-2015
I want to use ROW_NUMBER in sql server Please help me.
Updated on 26-Nov-2015
Anonymous User
26-Nov-2015ROW_NUMBER is a function built-in to SQL Server that will return a row number for each record in your result set. You can further change resulting row number to reset the row number based on some value in the result set.
PARTITION BY – If you supply this parameter, then the row number will reset based on the value changing in the columns supplied. This is kinda like using a GROUP BY.
ORDER BY – This is the specified order of the row number that you would like. If you wanted the order of the row number to increment by an employee name (alphabetically), you do that here.