Received: from smtp.dnet.net.id (engine9.dnet.net.id [202.148.1.21]) by mail.postgresql.org (8.11.1/8.11.1) with SMTP id f0I3Gt092102 for ; Wed, 17 Jan 2001 22:16:55 -0500 (EST) (envelope-from nizomi@dnet.net.id) Received: (qmail 17076 invoked from network); 18 Jan 2001 10:04:38 +0700 Received: from nizomi.dnet.net.id (HELO nizomi) (nizomi@202.148.1.41) by engine9.dnet.net.id with SMTP; 18 Jan 2001 10:04:38 +0700 From: Tubagus Nizomi Date: Thu, 18 Jan 2001 10:17:34 +0700 X-Mailer: KMail [version 1.1.99] Content-Type: text/plain; charset="us-ascii" To: pgsql-sql@postgresql.org References: <3A665AE3.CE43178B@greatpacific.com.au> In-Reply-To: <3A665AE3.CE43178B@greatpacific.com.au> Subject: Re: update help MIME-Version: 1.0 Message-Id: <01011810173404.01195@nizomi> Content-Transfer-Encoding: 8bit X-Archive-Number: 200101/203 X-Sequence-Number: 868 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