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

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Bruno Wolff III <bruno(at)wolff(dot)to>
Cc: William ZHANG <uniware(at)zedware(dot)org>, pgsql-general(at)postgresql(dot)org
Subject: Re: How I can get the real data type result instead of
Date: 2006-03-22 04:00:49
Message-ID: 9748.1143000049@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Bruno Wolff III <bruno(at)wolff(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2006-03-22 04:12:12 Re: Confused about a function returning SETOF
Previous Message Ken Winter 2006-03-22 04:00:33 Confused about a function returning SETOF