How can I best write a query that selects 10 rows randomly from a total of 600k?
Use the below simple query to get random data from a table.
SELECT user_firstname , COUNT(DISTINCT usr_fk_id) cnt FROM userdetails GROUP BY usr_fk_id ORDER BY cnt ASC LIMIT 10