Re: RANDOM function?

Поиск
Список
Период
Сортировка
От macky
Тема Re: RANDOM function?
Дата
Msg-id 00d101c11985$672ad690$5764a8c0@edsamail.com
обсуждение исходный текст
Ответ на Re: RANDOM function?  (Einar Karttunen <ekarttun@cs.Helsinki.FI>)
Ответы Re: RANDOM function?  (Einar Karttunen <ekarttun@cs.Helsinki.FI>)
Re: Re: RANDOM function?  (ghaverla@freenet.edmonton.ab.ca)
Список pgsql-novice
if ill be using big range of numbers sa 10000 woundd the be any possibility
to have multiple items... meaning lets say 1234 will show up more than once?
----------------------------------------------------------------------
The information contained in this message (including any attachments)
is confidential and intended solely for the attention and use of the
named addressee(s). It must not be copied, distributed nor disclosed
to any person. If you are not the intended recipient, please delete
it from your system and notify sender immediately. Any disclosure,
copying or distribution thereof or any action taken or omitted to be
taken in reliance thereon is prohibited and may be unlawful.
----------------------------------------------------------------------

----- Original Message -----
From: "Einar Karttunen" <ekarttun@cs.Helsinki.FI>
To: "macky" <macky@edsamail.com>
Cc: <pgsql-novice@postgresql.org>
Sent: Tuesday, July 31, 2001 1:50 PM
Subject: Re: RANDOM function?


> On Tue, 31 Jul 2001, macky wrote:
>
> > can someone point me to the documentation of RANDOM() function....
> >
> > and can i insert RANDOM POSTIVE WHOLE NUMBERS...?
> >
> > create table table_name (key int4);
> >
> > insert into table_name(key) values(random());  <-- this gives me a value
of
> > 1 and 0 only..
> >
> random produces a float between 0 and 1. Just multiple it with the
> interval you want and you will get the random number you want.
>
> eg. to get a random number between 0 and 100 -> 100 * random().
> between 32 and 40 -> (8 * random()) + 32.
>
> - Einar Karttunen
>
>
>


В списке pgsql-novice по дате отправления:

Предыдущее
От: Einar Karttunen
Дата:
Сообщение: Re: RANDOM function?
Следующее
От: Einar Karttunen
Дата:
Сообщение: Re: RANDOM function?