title: Selecting random rows with MySQL
body: <p>I saw many topics about this subject and I have been unsuccessful in understanding how to do it.</p>
  
  <p>For example, if I have this table:</p>
  
  <pre><code>+------+-------+-------+
  | id   | name  | class |
  +------+-------+-------+
  |    5 | test  | one   | 
  |   10 | test2 | one   | 
  |   12 | test5 | one   | 
  |    7 | test6 | two   | 
  +------+-------+-------+
  </code></pre>
  
  <p>and I want to show only X random rows from class "one", how can I do that?</p>
  
  <p><strong>NOTE</strong>: it's a big table, so I don't want to use <code>ORDER BY RAND</code>.</p>