Want to Pull "x" number of records.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • cocheese
    New Member
    • Apr 2007
    • 1

    Want to Pull "x" number of records.

    Hi. I'm working in Oracle SQL and i want to view the details on just 20 random records from a table. What's the proper syntax for this?
  • Saii
    Recognized Expert New Member
    • Apr 2007
    • 145

    #2
    See if this helps

    SELECT *
    FROM (SELECT *
    FROM <table_name>
    ORDER BY DBMS_RANDOM.ran dom ())
    WHERE ROWNUM <= 20;

    Comment

    Working...