How to retrieve a random sample of a percentage of a table’s rows ? Here goes the shorty for Oracle. Maybe there is another solution. But that one worked for me.


select * from
          (select * from table order by dbms_random.value)
        where rownum <= (select count(*)*0.1 from table)

the dbms_random.value is the trick for the random sample and the count(*)*0.1 is for the ten percent.