title: MySQL ORDER BY rand(), name ASC
body: <p>I would like to take a database of say, 1000 users and select 20 random ones (<code>ORDER BY rand()</code>,<code>LIMIT 20</code>) then order the resulting set by the names. I came up with the following query which is <em>not</em> working like I hoped.</p>
  
  <p><code>SELECT * FROM users WHERE 1 ORDER BY rand(), name ASC LIMIT 20</code></p>