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

Поиск
Список
Период
Сортировка
Искать
От
Bruno Wolff III
Тема
Re: How I can get the real data type result instead of integer data type?
Дата
Msg-id
20060320224519.GA7291@wolff.to
Ответ на
Список
Дерево обсуждения
Re: How I can get the real data type result instead of "William ZHANG" <uniware@zedware.org>
Re: How I can get the real data type result instead of Bruno Wolff III <bruno@wolff.to>
Re: How I can get the real data type result instead of Tom Lane <tgl@sss.pgh.pa.us>
On Mon, Mar 20, 2006 at 13:10:51 -0800,
  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.

You can cast the expressions. Something like:
order by count(id)::float/age::float
В списке pgsql-general по дате отправления
От: Tom Lane
Дата:
От: Vivek Khera
Дата:
FAQ