Cast question (NULL -> NUMERIC)

Поиск
Список
Период
Сортировка
Искать
От
Henry House
Тема
Cast question (NULL -> NUMERIC)
Дата
Msg-id
20010713115338.A12955@houseag.com
Список
Дерево обсуждения
Cast question (NULL -> NUMERIC) Henry House <hajhouse@houseag.com>
Re: Cast question (NULL -> NUMERIC) Tom Lane <tgl@sss.pgh.pa.us>
Re: Cast question (NULL -> NUMERIC) Henry House <hajhouse@houseag.com>
I have the following query:

	SELECT cast( sum(amount) AS NUMERIC(9,2) ) ... 
	WHERE postdate < $startdate 

(where $startdate is replaced with the user's entry at runtime) which returns
the balance forward of the amount column for the user-suplied date correcly
unless the user supplies a $startdate such that no culumns are being added.
In this case NULL is returned. I want to receive 0.00 in this case instead of
NULL, so I added the cast above, but NULL is still returned. Any ideas?

-- 
Henry House
OpenPGP key available from http://romana.hajhouse.org/hajhouse.asc
В списке pgsql-novice по дате отправления
От: GH
Дата:
Сообщение: Re: Silly newbie questions
От: Tom Lane
Дата:
FAQ