The following optimized select query select consecutive rows, i.e it chooses the first random row and the following ones will just be the ones below it:
SELECT name,r1.id
FROM entries AS r1 JOIN
(SELECT (RAND() *
(SELECT MAX(id)
FROM people)) AS id
) AS r2
WHERE r1.id >= r2.id
ORDER BY r1.id ASC
LIMIT 100;
But this one(not optimized) selects randomly:
SELECT distinct name, id FROM people
ORDER BY RAND()
LIMIT 100
How do we make the first random select query to function like the second?