How can I fetch 10 random values from 50k rows fastly including Inner Joins
Please Reply asap....
Thanks in advance
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Vinod SharmaPosted Sep 30, 2014, 3:30 AM
Munesh SharmaPosted Sep 30, 2014, 2:52 AM
JOIN (SELECT (RAND() * (SELECT MAX(id) FROM random)) AS id)
AS r2
WHERE r1.id >= r2.id ORDER BY r1.id ASC LIMIT 1
or go on this link
http://jan.kneschke.de/projects/mysql/order-by-rand/