Need to fetch random rownum from a table
Hi All
I need to fetch two random records from a table each time I query it. e.g. my_emp_table if this contains unique employee ids, is there any way to write a query which would give a two random employee records, say for first run 11 and 18 and next time 20 and 28 employee record.
We can get random values by select TRUNC(dbms_random.value(1,250)), TRUNC(dbms_random.value(1,250)) num from dual
but how do I use these values to get the Nth record using sql?
Any help will be appreciated.
Many Thanks!!
- Shashank