Re: update help

Поиск
Список
Период
Сортировка
От Carolyn Lu Wong
Тема Re: update help
Дата
Msg-id 3A6669ED.C37F420C@greatpacific.com.au
обсуждение исходный текст
Ответ на update help  (Carolyn Wong <carolyn@greatpacific.com.au>)
Список pgsql-sql
This update field with the sum of all amounts in t2. I want to update
sum of each individual IDs.


Tubagus Nizomi wrote:
> 
> update t1
> set amount = sum(b.amount)
> from ts b
> where a.id=b.id
> 
> On Thursday 18 January 2001 09:54, Carolyn Wong wrote:
> > I'd like to know what's the correct SQL statement to do the following:
> >
> > update        t1 a
> > set   a.amount = sum(b.amount)
> > from  t2 b
> > where a.id = b.id


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: update help
Следующее
От: Carolyn Lu Wong
Дата:
Сообщение: Re: update help