Re: selecting a random record - Mailing list pgsql-general

From Culley Harrelson
Subject Re: selecting a random record
Date
Msg-id 20010206212554.81167.qmail@web9604.mail.yahoo.com
Whole thread Raw
In response to selecting a random record  (Culley Harrelson <culleyharrelson@yahoo.com>)
List pgsql-general
Can this be done in the framework of plpgsql?  I know
I can do it in the front end (java) but it would be
nice to aviod having to grab the rowcount first.  I
haven't seen a random function in the documentation.
I could install another language but boy am I lazy :)


--- Mark Lane <mlane@mynewthing.com> wrote:
> On Tuesday 06 February 2001 13:11, you wrote:
> > Any suggestions on how to select a random record
> from
> > any given table?
> >
> > Culley
> >
> Set the range of the table index to a random number
> generator.
>
> if the index ranges from 100 to 10000 then you would
> multiply you random
> number by 9900 and then 100 to generate a random
> index number. Just remember
> to round the number to an integer.
>
> Mark


__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - Buy the things you want at great prices.
http://auctions.yahoo.com/

pgsql-general by date:

Previous
From: Tim Uckun
Date:
Subject: Re: new type proposal
Next
From: "Mitch Vincent"
Date:
Subject: Re: full text searching