Check out example codes for "mysql row_number() example". It will help you in understanding the concepts better.

Code Example 1

SET @row_number = 0; 
SELECT 
    (@row_number:[email protected]_number + 1) AS num, 
    firstName, 
    lastName
FROM
    employees
ORDER BY firstName, lastName    
LIMIT 5;

Code Example 2

set @row_number := 0;

SELECT 
    @row_number:=CASE
        WHEN @customer_no = customerNumber 
			THEN @row_number + 1
        ELSE 1
    END AS num,
    @customer_no:=customerNumber customerNumber,
    paymentDate,
    amount
FROM
    payments
ORDER BY customerNumber;

Code Example 3

SELECT row_number() over ( order by firstName) RowNumberSqeuence,FirstName from rowNumberDemo
 order by FirstName;

Learn ReactJs, React Native from akashmittal.com