title: Oracle random row from table
body: <p>I found this solution for selecting a random row from a table in Oracle. Actually sorting rows in a random manner, but you can fetch only the first row for a random result.</p>
  
  <pre><code>SELECT *
  FROM table
  ORDER BY dbms_random.value;
  </code></pre>
  
  <p>I just don't understand how it works. After ORDER BY it should be a column used for sorting. I see that "dbms_random.value" returns a value lower than zero. This behavior can be explained or is just like that?</p>
  
  <p>Thanks</p>