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

2006-03-21 Thread Tom Lane
Bruno Wolff III <[EMAIL PROTECTED]> 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

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

2006-03-21 Thread Bruno Wolff III
On Tue, Mar 21, 2006 at 21:16:03 +0800, William ZHANG <[EMAIL PROTECTED]> wrote: > > "Sigurdur Gunnlaugsson" <[EMAIL PROTECTED]> > > 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(i

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

2006-03-21 Thread William ZHANG
"Sigurdur Gunnlaugsson" <[EMAIL PROTECTED]> > 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) Regards, William ZHANG ---(end of broadcast)

Re: [GENERAL] How I can get the real data type result instead of integer data type?

2006-03-20 Thread Bruno Wolff III
On Mon, Mar 20, 2006 at 13:10:51 -0800, Wei Wei <[EMAIL PROTECTED]> 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 re

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

2006-03-20 Thread Sigurdur Gunnlaugsson
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 t