Re: stored procedure

Поиск
Список
Период
Сортировка
От Bruno Wolff III
Тема Re: stored procedure
Дата
Msg-id 20030401165141.GA16823@wolff.to
обсуждение исходный текст
Ответ на Re: stored procedure  (Peter Choe <choepete@mindspring.com>)
Ответы Re: stored procedure  (Dennis Gearon <gearond@cvc.net>)
Список pgsql-general
On Tue, Apr 01, 2003 at 11:26:47 -0500,
  Peter Choe <choepete@mindspring.com> wrote:
> thanks.  i just tried it out and it seems that it would generate a
> random number between 0 and 1.  is that a valid assumption?  if that is
> the case, how can i cast it to an int value?  i assume that there is a
> cast function somewhere, but i can't tell by the names of the pronames.

Normally you multiply by the range you want and then you can make a cast.
Note however, that multiplication may cause a value to round up so that
(6*random())::int might on very rare occasions return 6 instead of the
expected 0, 1, 2, 3, 4 or 5. (At least on some systems.)


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

Предыдущее
От: Stephan Szabo
Дата:
Сообщение: Re: deferred constraint trigger problem
Следующее
От: Dennis Gearon
Дата:
Сообщение: Re: Newsgroups/sites for SQL questions?