Re: select 5/2???

From: missive(at)frontiernet(dot)net (Lee Harr)
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: select 5/2???
Date: 2001-10-04 00:23:04
Message-ID: 9pga58$1b7d$2@news.tht.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

>
> I run select 5/2 = 2
> who to get "2.5"
>

integer/integer = integer
float/integer = float
integer/float = float
integer/integer::float = float

test=# SELECT 5.0/2;
?column?
----------
2.5
(1 row)

test=# SELECT 5/2::float;
?column?
----------
2.5

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message cnliou 2001-10-04 01:06:04 SubQuery
Previous Message jason.servetar 2001-10-03 21:36:31 Re: to_date/to timestamp going to BC