Re: simple division - Mailing list pgsql-general

From Albrecht Dreß
Subject Re: simple division
Date
Msg-id KPCM4OKT.PSPJVDUQ.5KB2VTH5@M4XLVGAH.A3E4IHUJ.2PVXUPVH
Whole thread Raw
In response to Re: simple division  (Martin Mueller <martinmueller@northwestern.edu>)
List 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.
Attachment

pgsql-general by date:

Previous
From: Ron
Date:
Subject: Re: simple division
Next
From: Martin Mueller
Date:
Subject: Re: simple division