pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Carolyn Lu Wong <carolyn@greatpacific.com.au>
To: Tubagus Nizomi <nizomi@dnet.net.id>
Cc: pgsql-sql@postgresql.org
Subject: Re: update help
Date: Thu, 18 Jan 2001 14:58:37 +1100
Message-ID: <3A6669ED.C37F420C@greatpacific.com.au> (raw)
References: <3A665AE3.CE43178B@greatpacific.com.au>
	<01011810173404.01195@nizomi>

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



view thread (12+ messages)  latest in thread

Message-ID: <3A6669ED.C37F420C@greatpacific.com.au>
Permalink:  ../3A6669ED.C37F420C@greatpacific.com.au/
Also on:    postgresql.org/message-id/3A6669ED.C37F420C@greatpacific.com.au

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: carolyn@greatpacific.com.au, nizomi@dnet.net.id
  Subject: Re: update help
  In-Reply-To: <3A6669ED.C37F420C@greatpacific.com.au>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox