Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: random records
Faby wrote:
> Hi, I have to select 50 random records from a table. How should i > proceed? Should I use "sample", "dbms_random.value"...? > Thanks
If you want to list the first X amount of records that Oracle stumbles across in a particular table, check out the ROWNUM pseudo-column.
For example:
SQL> select object_name
2 from all_objects
3 where rownum <= 10;
OBJECT_NAME
10 rows selected.
HTH -g Received on Wed Jul 12 2006 - 05:09:51 CDT
![]() |
![]() |