Re: simple division

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Re: simple division
Дата
Msg-id CAKFQuwZXO4WJqEbmWUtnCvDhRfVqYWbFx7bQ8D-Q-mxPRqEKgg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: simple division  ("Joshua D. Drake" <jd@commandprompt.com>)
Ответы Re: simple division
Список pgsql-general
On Tue, Dec 4, 2018 at 1:38 PM Joshua D. Drake <jd@commandprompt.com> wrote:
> I may be misunderstanding the question but:
Indeed...
> select cast(x/y as numeric(10,4));

Your answer is 2.0 instead of the correct 2.5 - you need to cast
before the division, not after.

David J.


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

Предыдущее
От: "David G. Johnston"
Дата:
Сообщение: Re: simple division
Следующее
От: Rob Nikander
Дата:
Сообщение: querying both text and non-text properties