I am trying to find a way to pull 10 random records and then order these 10 records by field. I tried the following:
SELECT name FROM users ORDER BY RAND (), name LIMIT 10
but it does not sort by name with 10 rows returned, it simply returns 10 random records in any order. Is there a way to sort by rand () and field inside a query with MySQL?
source
share