Re: simple division

Поиск
Список
Период
Сортировка
От Albrecht Dreß
Тема Re: simple division
Дата
Msg-id KPCM4OKT.PSPJVDUQ.5KB2VTH5@M4XLVGAH.A3E4IHUJ.2PVXUPVH
обсуждение исходный текст
Ответ на Re: simple division  (Martin Mueller <martinmueller@northwestern.edu>)
Список pgsql-general
Am 04.12.18 21:57 schrieb(en) Martin Mueller:
> I didn't formulate my question properly, because the query went like
>  "select alldefects /wordcount"
> where alldefects and wordcount are integers.

test=# create table xxx(alldefects bigint, wordcount bigint);
CREATE TABLE
test=# insert into xxx values (4, 10);
INSERT 0 1
test=# insert into xxx values (3, 17);
INSERT 0 1
test=# select alldefects::real / wordcount::real from xxx;
  ?column?
----------
       0.4
  0.176471
(2 rows)

Hth,
Albrecht.
Вложения

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

Предыдущее
От: Ron
Дата:
Сообщение: Re: simple division
Следующее
От: Martin Mueller
Дата:
Сообщение: Re: simple division