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

From Tom Lane
Subject Re: How I can get the real data type result instead of
Date
Msg-id 9748.1143000049@sss.pgh.pa.us
Whole thread Raw
In response to Re: How I can get the real data type result instead of  (Bruno Wolff III <bruno@wolff.to>)
List pgsql-general
Bruno Wolff III <bruno@wolff.to> writes:
>>> 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?

Yeah.  The :: case is OK because :: binds more tightly than /
but the second suggestion is wrong :-(

            regards, tom lane

pgsql-general by date:

Previous
From: "Ken Winter"
Date:
Subject: Confused about a function returning SETOF
Next
From: Tom Lane
Date:
Subject: Re: Confused about a function returning SETOF