Re: UPDATE and outer joins

From: Manfred Koizar <mkoi-pg(at)aon(dot)at>
To: "Harry Broomhall" <harry(dot)broomhall(at)uk(dot)easynet(dot)net>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: UPDATE and outer joins
Date: 2003-10-08 14:29:48
Message-ID: k978ov0vibitnj3v5bk7o790mv2vmq03t4@email.aon.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, 8 Oct 2003 12:23:04 +0100 (BST), Harry Broomhall
<harry(dot)broomhall(at)uk(dot)easynet(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Harry Broomhall 2003-10-08 14:40:13 Re: UPDATE and outer joins
Previous Message Bruno Wolff III 2003-10-08 14:29:42 Re: UPDATE and outer joins