Organizational Research By

Surprising Reserch Topic questions - Question:how to Get 10 rows from a query

I have a query which consists of joins and has an output of about 30,000+ records. I would like to get 10 random rows from these records without using SQL command rand().

I tried looping through the records and put them in an array and shuffle (get the 1st 10 after shuffle) them but it takes about 8-12 seconds to generate. I would like to reduce this processing time at all cost.

How will I accomplish this?

asked Sep 13, 2013 in MYSQL by rajesh
edited Sep 12, 2013
0 votes

Related Hot Questions

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please log in or register.