Re: How I can get the real data type result instead of integer data type? - Mailing list pgsql-general

From Bruno Wolff III
Subject Re: How I can get the real data type result instead of integer data type?
Date
Msg-id 20060320224519.GA7291@wolff.to
Whole thread Raw
In response to How I can get the real data type result instead of integer data type?  ("Wei Wei" <wei725@lycos.com>)
List pgsql-general
On Mon, Mar 20, 2006 at 13:10:51 -0800,
  Wei Wei <wei725@lycos.com> wrote:
> In a query, there is something like
>
> order by count(id)/age
>
> where both id and age are the integer data type.
>
> From a query result, I believe the operation count(id)/age yields a integer. I need it in real data type. After
searchingthe online document, I haven't found any related information. Can someone help me out on this problem, please. 

You can cast the expressions. Something like:
order by count(id)::float/age::float

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Difference between "add column" and "add column" with default
Next
From: Vivek Khera
Date:
Subject: Re: What's a good default encoding?