title: Using MySQL RAND() to avoid ORDER BY RAND()
body: <p>I am storing <code>RAND()</code> value in a table on each insert and then I run following query to get random rows from the table.</p>
  
  <pre><code>select id from test where random_value &gt;= RAND() LIMIT 5;
  </code></pre>
  
  <p>There are total 456 rows in a table but the random value is only picking up first 20-25 records. I ran many times above query but never got <code>id &gt; 21</code>.</p>
  
  <p>You can find queries and results <a href="http://pastebin.com/DHgTBERW" rel="nofollow">here</a>.</p>