ROW_NUMBER

Numbering of rows in accordance with the order of values of a primary key

Numbering of a query result set

Paging records

About window functions

ROW_NUMBER function

About ranking functions

Equivalents for analytic functions

MySQL. Usage of query variables

Numbering rows when there are duplicates in the results column

Numbering of a query result set

RANK() and DENSE_RANK() functions

About ranking functions