Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Random Numbers in PL/SQL

Re: Random Numbers in PL/SQL

From: Paulo Jorge Leitão <paulojl_at_esoterica.pt>
Date: Tue, 27 Apr 1999 17:39:09 +0100
Message-ID: <7g4p8f$6k6$1@duke.telepac.pt>


HI!

in Oracle 8i you can use the rownum in your select

select * from table_1 where rownum in (23,67,89,...,)

you only need to generate random numbers of the rows you want

hope it helps

<youngsod_at_my-dejanews.com> wrote in message news:7g3t28$8lr$1_at_nnrp1.dejanews.com...
> Sorry if this has been asked before, but I need some help.
>
> I have a table with around 27000 records at present and growing.
>
> The primary key is a varchar2(7) ID 1234567 , not created sequentially.
>
> I need to be able to get a random sample of 100 records from the table.
>
> Any ideas ?
>
> Douglas
>
> -----------== Posted via Deja News, The Discussion Network ==----------
> http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
Received on Tue Apr 27 1999 - 11:39:09 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US