Re: Update Join Query

Поиск
Список
Период
Сортировка
От Antonio Perez
Тема Re: Update Join Query
Дата
Msg-id 16124.34852.qm@web56210.mail.re3.yahoo.com
обсуждение исходный текст
Ответ на Update Join Query  ("Daniel Futerman" <daniel.futerman@gmail.com>)
Список pgsql-general


--- El lun 23-jun-08, Daniel Futerman <daniel.futerman@gmail.com> escribió:
De: Daniel Futerman <daniel.futerman@gmail.com>
Asunto: [GENERAL] Update Join Query
A: pgsql-general@postgresql.org
Fecha: lunes, 23 junio, 2008, 4:43 pm

Hi,

Looking for the correct syntax for an UPDATE LEFT JOIN query in PostgreSQL.

The equivalent MySQL query is :

    UPDATE
        Foo f LEFT JOIN Goo g on f.Foo_ID = g.Goo_ID
    SET
        f.Foo_ID = g.Goo_ID
    WHERE
        f.Foo_ID IS NOT NULL;


 When I try to run this in Postgres, i get the following error:

ERROR:  syntax error at or near "LEFT"

Is it possible to have UPDATE JOIN queries in PostgreSQL?

Thanks.

sorry the last message have a error

try whit this

update foo set Foo_ID = goo.Goo_ID from goo where goo.Goo_id = foo.Foo_id and foo_ID IS NOT NULL;

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

Предыдущее
От: "Leif B. Kristensen"
Дата:
Сообщение: Re: dbsize command
Следующее
От: Garry Saddington
Дата:
Сообщение: Unicode problem again