Re: UPDATE and outer joins - Mailing list pgsql-general

From Manfred Koizar
Subject Re: UPDATE and outer joins
Date
Msg-id k978ov0vibitnj3v5bk7o790mv2vmq03t4@email.aon.at
Whole thread Raw
In response to UPDATE and outer joins  (Harry Broomhall <harry.broomhall@uk.easynet.net>)
Responses Re: UPDATE and outer joins
List pgsql-general
On Wed, 8 Oct 2003 12:23:04 +0100 (BST), Harry Broomhall
<harry.broomhall@uk.easynet.net> wrote:
>I am currently
>doing a left outer join into a temporary file, then the UPDATE, but this
>involves two joins!

    UPDATE a
       SET col1 = b.col11, col2 = b.col12
      FROM a AS x LEFT JOIN b ON (x.??? = b.???)
     WHERE a.pk = x.pk;

might not run faster, but at least it is only one statement and you
don't have to care for temporary tables ...

Servus
 Manfred

pgsql-general by date:

Previous
From: Bruno Wolff III
Date:
Subject: Re: UPDATE and outer joins
Next
From: Harry Broomhall
Date:
Subject: Re: UPDATE and outer joins