Re: How I can get the real data type result instead of

From: Sigurdur Gunnlaugsson <sig(at)fjolnet(dot)net>
To: Wei Wei <wei725(at)lycos(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: How I can get the real data type result instead of
Date: 2006-03-20 21:44:35
Message-ID: 1142891075.13455.4.camel@raftahlid35
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Mon, 2006-03-20 at 21:10, Wei Wei 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 searching the online document, I haven't found any related information. Can someone help me out on this problem, please.
>
> Thanks,
>
> w

Try:

order by count(id)/age::float

regards,
Sig.Gunn

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2006-03-20 22:15:54 Re: db sever seems to be dropping connections
Previous Message mike 2006-03-20 21:31:55 Re: question about pg_hba.conf