Search Postgresql Archives

Re: simple division

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.

Attachment: pgp6w0ZtdLjTF.pgp
Description: PGP signature


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux