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

From: Bruno Wolff III <bruno(at)wolff(dot)to>
To: William ZHANG <uniware(at)zedware(dot)org>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: How I can get the real data type result instead of
Date: 2006-03-22 03:31:37
Message-ID: 20060322033137.GB2262@wolff.to
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, Mar 21, 2006 at 21:16:03 +0800,
William ZHANG <uniware(at)zedware(dot)org> wrote:
>
> "Sigurdur Gunnlaugsson" <sig(at)fjolnet(dot)net>
> > On Mon, 2006-03-20 at 21:10, Wei Wei wrote:
> >
> > Try:
> >
> > order by count(id)/age::float
>
> Or you can use the standard grammer:
>
> order by cast(count(id)/age as float)

Don't you have to cast before the divide? I think the above will convert
the truncated result to float.
However he could do something like:
order by count(id)/cast(age as float)

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Andrew Dunstan 2006-03-22 03:34:45 Re: Modular Type Libraries: was A real currency type
Previous Message Tom Lane 2006-03-22 03:31:00 Re: Modular Type Libraries: was A real currency type