Re: selecting a random record

Поиск
Список
Период
Сортировка
От Culley Harrelson
Тема Re: selecting a random record
Дата
Msg-id 20010206212554.81167.qmail@web9604.mail.yahoo.com
обсуждение исходный текст
Ответ на selecting a random record  (Culley Harrelson <culleyharrelson@yahoo.com>)
Список 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 по дате отправления:

Предыдущее
От: Tim Uckun
Дата:
Сообщение: Re: new type proposal
Следующее
От: "Mitch Vincent"
Дата:
Сообщение: Re: full text searching