Re: How to use outer join in update - Mailing list pgsql-general

From Alban Hertroys
Subject Re: How to use outer join in update
Date
Msg-id 45792BC1.3040305@magproductions.nl
Whole thread Raw
In response to How to use outer join in update  ("Andrus" <kobruleht2@hot.ee>)
Responses Re: How to use outer join in update  ("Shoaib Mir" <shoaibmir@gmail.com>)
Re: How to use outer join in update  (Ragnar <gnari@hive.is>)
List pgsql-general
Andrus wrote:
> In my current DBMS I can use
>
> create table t1 ( f1 int, f2 int );
> create table t2 ( f3 int, f4 int );
> update t1 set f1=t2.f3 from t1 left join t2 on  t1.f2=t2.f4

That looks like a self-join on t1 without using an alias for the second
instance of t1.

I think you meant:
update t1 set f1=t2.f3 from t2 where f2 = t2.f4

--
Alban Hertroys
alban@magproductions.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 //

pgsql-general by date:

Previous
From: "Shoaib Mir"
Date:
Subject: Re: Auto Backup facility?
Next
From: Michael Glaesemann
Date:
Subject: Re: