Code mẫu

ROW_NUMBER ( ) OVER ( [ PARTITION BY value_expression , ... [ n ] ] order_by_clause )

 

Ví dụ:

SELECT
  ROW_NUMBER() OVER (ORDER BY AlbumId ASC) 'Row',
  AlbumId,
  AlbumName
FROM Albums;