1

How to get random output of multiple rows from any table in Oracle? Also what is the meaning of (dbms_random.value)

select *
from (select *
      from emp
      order by dbms_random.value)
where rownum=1;

It gives only one random output. How do I get multiple?

0

1 Answer 1

2

try

select * from (select * from emp order by dbms_random.value) where rownum<10

10 can be replaced by any other count of your choice

Sign up to request clarification or add additional context in comments.

3 Comments

sir, what is the meaning of dbms_random.value
Its an inbuild random number generator for oracle.
I am glad i could help you. Will appreciate if you can accept the answer.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.