Re: trying to do an update a bit confused.
От
Jaime Casanova
Тема
Re: trying to do an update a bit confused.
Дата
Msg-id
c2d9e70e050419160340f7c31d@mail.gmail.com
Ответ на
trying to do an update a bit confused. (Joel Fradkin)
Список
Дерево обсуждения
Re: trying to do an update a bit confused. KÖPFERL Robert <robert.koepferl@sonorys.at>
Re: trying to do an update a bit confused. "Joel Fradkin" <jfradkin@wazagua.com>
On 4/19/05, Joel Fradkin wrote: > > > > update tblcase set merchandisetotal = > > ( > > COALESCE(( SELECT sum(m.quantity::numeric * m.amount) AS merchandiseamount > > FROM tblmerchandise m > > WHERE m.caseid = tblcase.caseid AND m.clientnum::text = > tblcase.clientnum::text), 0.0) > > ) > > Put the coalesce inside the select: update tblcase set merchandisetotal = (SELECT COALESCE(sum(m.quantity::numeric * m.amount),0.0) AS merchandiseamount FROM tblmerchandise m WHERE m.caseid = tblcase.caseid AND m.clientnum::text = tblcase.clientnum::text) -- Regards, DBA* Jaime Casanova (DBA: DataBase Aniquilator ;)
В списке pgsql-sql по дате отправления