title: How Oracle SAMPLE clause work?
body: <p>My group is doing a data evaluation request from client. We planed to use SAMPLE clause to extract some rows randomly from a table in our Oracle 11g database. After some research, we found there are no detailed explanation about how this SAMPLE clause work (process, algorithm, random number generator). Oracle documentation only explains how to use it and syntax but not in detail. The most detailed explanation I found is below from Asktom.</p>
  
  <p><a href="https://asktom.oracle.com/pls/apex/asktom.search?tag=random-sample-20000824" rel="nofollow noreferrer">https://asktom.oracle.com/pls/apex/asktom.search?tag=random-sample-20000824</a></p>
  
  <blockquote>
    <p>Think of it like this, we goto each row -- we generate a random number
    between 0.00 and 1.00. If the number if 0.05 or less -- then the row
    is output. If the number is above 0.05 we don't output it. </p>
    
    <p>It could very well turn out that due to randomness -- a sample 5% on a
    small set will return 0 rows!!! We could generate a random number >
    0.05 100 out of 100 time (not probable but possible)</p>
  </blockquote>
  
  <p>I could understand statistic methodology behind it. But that is still too conceptually. I want to know how exactly that random number be generated or validation from some kind of official document.</p>
  
  <p>Could anybody give me a more detailed explanation about the clause?</p>
  
  <p>Thank you</p>