cast int to float

Поиск
Список
Период
Сортировка
От sheila timp
Тема cast int to float
Дата
Msg-id F268gEHCqHkl9UP1X010000eae4@hotmail.com
обсуждение исходный текст
Ответы Re: cast int to float  ("Josh Berkus" <josh@agliodbs.com>)
Список pgsql-novice


Hi,

I'm creating a new database-item by dividing two existing items. When these
items are initially declared as float, there is no problem. On the other
hand, when they are declared as int initially and later converted to float,
I get the error: float8div: divide by zero error. Maybe I didn't do the
casting right. This is what I did:

((cast(item1 as float))/(cast(item2 as float) + cast (item3 as float))) as
item4.

I played around with putting the brackets at different places, but every
time got the same error message.
Hopefully someone can advise me what to do,

Thanks Sheila


_________________________________________________________________
MSN Photos is the easiest way to share and print your photos:
http://photos.msn.com/support/worldwide.aspx


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

Предыдущее
От: Frank Bax
Дата:
Сообщение: Re: Three table query
Следующее
От: Francisco Reyes
Дата:
Сообщение: Re: appropriate sort_mem & shared buffers