RowNumber() Function

Is this what you’re looking for?