Re: Recasting data type

Поиск
Список
Период
Сортировка
От David Merrill
Тема Re: Recasting data type
Дата
Msg-id 20010207150702.B6493@lupercalia.net
обсуждение исходный текст
Ответ на Recasting data type  (Conrad Schuler <conrad.schuler@masks.org>)
Список pgsql-novice
On Wed, Feb 07, 2001 at 11:31:43AM -0800, Conrad Schuler wrote:
> Hi All,
>
> Thanks for the help on the 'lumper' vs. 'splitter' question.
>
> I asked my practice database:
>
> select count (*) from titles where price > 20
>
> It responded:
>
> PostgreSQL said: ERROR: Unable to identify an operator '>' for types
> 'money' and 'int4' You will have to retype this query using an explicit cast
>
> I tried variations on this theme and got nowhere:
> select count (*) from titles cast(price as float8) where price > 20

Why don't you try:

select count(*) from titles where price > 20.00

It seems that the explicit decimal should automatically cause the
cast. I'm not positive it will work, but it's worth a try.

--
Dr. David C. Merrill                     http://www.lupercalia.net
Linux Documentation Project                   david@lupercalia.net
Collection Editor & Coordinator            http://www.linuxdoc.org
                                       Finger me for my public key

One seldom sees a monument to a committee.

В списке pgsql-novice по дате отправления:

Предыдущее
От: Francisco Reyes
Дата:
Сообщение: Re: Re: RE: Sizing of LARGE databases.
Следующее
От: Leandro Fanzone
Дата:
Сообщение: Secondary indexes