De: Daniel Futerman <daniel.futerman@gmail.com>Asunto: [GENERAL] Update Join QueryA: pgsql-general@postgresql.orgFecha: lunes, 23 junio, 2008, 4:43 pmHi,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.Try this..UPDATE Foo f SET f.Foo_ID = g.Goo_IDFROM ( select g.Goo_ID from Goo g RIGHT JOIN Foo f on (f.Foo_ID = g.Goo_ID) WHERE f.Foo_ID IS NOT NULL; ) g
pgsql-general by date:
Соглашаюсь с условиями обработки персональных данных