From: Tom Lane <tgl@sss.pgh.pa.us>
To: Carolyn Lu Wong <carolyn@greatpacific.com.au>
Cc: pgsql-sql@postgresql.org <pgsql-sql@postgresql.org>
Subject: Re: update help
Date: Wed, 17 Jan 2001 23:18:57 -0500
Message-ID: <23145.979791537@sss.pgh.pa.us> (raw)
In-Reply-To: <3A666A8F.591B8315@greatpacific.com.au>
References: <3A665AE3.CE43178B@greatpacific.com.au>
<22930.979787939@sss.pgh.pa.us>
<3A666A8F.591B8315@greatpacific.com.au>
Carolyn Lu Wong <carolyn@greatpacific.com.au> writes:
> Forgot to mention that I'm using V6.5.
Oh. 6.5's support for sub-selects is pretty limited :-(.
I think the only way to do it in 6.5 is with a temp table,
eg
SELECT id, sum(amount) as sum into temp table tt from t2 group by id;
update t1 set amount = tt.sum where id = tt.id;
drop table tt;
You might wanna think about updating sometime soon...
regards, tom lane
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: tgl@sss.pgh.pa.us, carolyn@greatpacific.com.au
Subject: Re: update help
In-Reply-To: <23145.979791537@sss.pgh.pa.us>
* 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