Re: trying to do an update a bit confused.

Поиск
Список
Период
Сортировка
От KÖPFERL Robert
Тема Re: trying to do an update a bit confused.
Дата
Msg-id ED4E30DD9C43D5118DFB00508BBBA76EB166C0@neptun.sonorys.at
обсуждение исходный текст
Ответ на trying to do an update a bit confused.  ("Joel Fradkin" <jfradkin@wazagua.com>)
Ответы Re: trying to do an update a bit confused.  ("Joel Fradkin" <jfradkin@wazagua.com>)
Список pgsql-sql
You're most probably missing a Where clause after the parentensis. see:
-----Original Message-----
From: Joel Fradkin [mailto:jfradkin@wazagua.com]
Sent: Dienstag, 19. April 2005 16:06
To: pgsql-sql@postgresql.org
Subject: [SQL] trying to do an update a bit confused.

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)

) 

WHERE <condtion that selects one record>;

 

 

I tried running the above and it wants to do a sum on all the records in tblcase instead of just the one being updated, what am I doing wrong?

 

Joel Fradkin

 

 

 

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: DateAdd function ?
Следующее
От: "Muhyiddin A.M Hayat"
Дата:
Сообщение: Debet-Credit-Balance Calculation