Check out example codes for "mysql row generator". It will help you in understanding the concepts better.
Code Example 1
SELECT @curRow := @curRow + 1 AS row_number
FROM sometable
JOIN (SELECT @curRow := 0) r
WHERE @curRow<100;
Learn ReactJs, React Native from akashmittal.com