Re: Can I use a query with UPDATE on its SET?

From: Craig Ringer <craig(at)postnewspapers(dot)com(dot)au>
To: eus(at)member(dot)fsf(dot)org
Cc: Postgresql General Mailing List <pgsql-general(at)postgresql(dot)org>
Subject: Re: Can I use a query with UPDATE on its SET?
Date: 2009-02-26 04:24:13
Message-ID: 49A6196D.7000105@postnewspapers.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Eus wrote:
> Hi Ho!
>
> Since I can do:
>
> INSERT INTO table (SELECT a_transaction.*);
>
> I am wondering whether I can do:
>
> UPDATE table SET (SELECT a_transaction.*) WHERE primary_key = (SELECT a_transaction.primary_key);

UPDATE table SET fieldname = (SELECT ..) WHERE primary_key = (SELECT...)

--
Craig Ringer

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Alban Hertroys 2009-02-26 09:46:30 Re: funny view/temp table problem with query
Previous Message Glen Parker 2009-02-26 01:26:44 Table partitioning and query plans