Re: SQL subquery question

From: Alban Hertroys <alban(at)magproductions(dot)nl>
To: Rick Schumeyer <rschumeyer(at)ieee(dot)org>
Cc: pgsql mailing list <pgsql-general(at)postgresql(dot)org>
Subject: Re: SQL subquery question
Date: 2006-11-15 13:47:00
Message-ID: 455B1A54.7000508@magproductions.nl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Rick Schumeyer wrote:
> foreach f in tsubset
> update tsubset set k=(select k from t, tsubset where t.f=f);
> end
>
> Can this be done with one SQL statement?

I think you mean
update tsubset set k = t.k from t where t.f = f;

--
Alban Hertroys
alban(at)magproductions(dot)nl

magproductions b.v.

T: ++31(0)534346874
F: ++31(0)534346876
M:
I: www.magproductions.nl
A: Postbus 416
7500 AK Enschede

// Integrate Your World //

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Rick Schumeyer 2006-11-15 14:03:07 Re: SQL subquery question
Previous Message Matthias.Pitzl 2006-11-15 13:44:46 Question about query optimization