Re: How to use outer join in update

Поиск
Список
Период
Сортировка
От Ragnar
Тема Re: How to use outer join in update
Дата
Msg-id 1165573076.379.70.camel@localhost.localdomain
обсуждение исходный текст
Ответ на Re: How to use outer join in update  (Alban Hertroys <alban@magproductions.nl>)
Ответы Re: How to use outer join in update  (Ragnar <gnari@hive.is>)
Re: How to use outer join in update  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
On fös, 2006-12-08 at 10:09 +0100, Alban Hertroys wrote:
> 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

is this not effectively an INNER JOIN ?
the OP needed a LEFT JOIN.

gnari



В списке pgsql-general по дате отправления:

Предыдущее
От: Martijn van Oosterhout
Дата:
Сообщение: Re: Internal function call from C-language function
Следующее
От: Ragnar
Дата:
Сообщение: Re: How to use outer join in update