Link to home
Start Free TrialLog in
Avatar of morinia
moriniaFlag for United States of America

asked on

selecting random records in an Oracle query

Experts,

I would like to select a certain number of random records in an Oracle query.

SELECT  *
FROM    (
        SELECT  *
        FROM    mytable
        ORDER BY
                dbms_random.value
        )
WHERE rownum <= 1000

I saw this code on the internet.  Can someone tell me what dbms_random.value is.  I
ASKER CERTIFIED SOLUTION
Avatar of Steve Wales
Steve Wales
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial