Re: Update from select?? - Mailing list pgsql-general

From Bruno Wolff III
Subject Re: Update from select??
Date
Msg-id 20030703191645.GA24120@wolff.to
Whole thread Raw
In response to Update from select??  ("jose antonio leo" <jaleo8@storelandia.com>)
List pgsql-general
On Thu, Jul 03, 2003 at 20:37:27 +0200,
  jose antonio leo <jaleo8@storelandia.com> wrote:
> Hi all,
>
> I need do a update from t1 set col='P' where int_art = (SELECT int_art from
> t2 ....).
> I know that thios sentence is not correct but I'd like do the update for
> everethigs rows that return the select.

You want something like:
update t1 set col = 'P' from t2 where t1.int_art = t2.int_art;

pgsql-general by date:

Previous
From: psql-mail@freeuk.com
Date:
Subject: Concatenating two Text fields from the same tuple
Next
From: "andy morrow"
Date:
Subject: Re: problems with pg_restore to 7.3.3 db