If you want to select random rows from a table, you can order the rows using the dbms_random.value function :
SELECT COLUMN FROM TABLE ORDER BY dbms_random.VALUE
To get 20 random rows from the table, we can add a condition on rownum. This selects the first 20 rows :
SELECT COLUMN FROM ( SELECT COLUMN FROM TABLE ORDER BY dbms_random.VALUE ) WHERE rownum < 21
With thanks to this site.
Post a Comment