Re: [GENERAL] Update Join Query

2008-06-23 Thread Craig Ringer
Daniel Futerman wrote: Is it possible to have UPDATE JOIN queries in PostgreSQL? Yes: UPDATE target FROM othertable; As far as I know Pg can only do an inner join on the update target. This can be easily be turned into an outer join with something like: UPDATE target FROM

Re: [GENERAL] Update Join Query

2008-06-23 Thread Antonio Perez
--- El lun 23-jun-08, Daniel Futerman <[EMAIL PROTECTED]> escribió: De: Daniel Futerman <[EMAIL PROTECTED]> 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 i

Re: [GENERAL] Update Join Query

2008-06-23 Thread Antonio Perez
--- El lun 23-jun-08, Daniel Futerman <[EMAIL PROTECTED]> escribió: De: Daniel Futerman <[EMAIL PROTECTED]> 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 i

Re: [GENERAL] Update Join Query

2008-06-23 Thread Mark Roberts
update foo set foo_id = g.goo_id from goo g where foo.foo_id = g.goo_id and foo.foo_id is not null I think. :) -Mark On Mon, 2008-06-23 at 21:43 +0200, Daniel Futerman wrote: > Hi, > > Looking for the correct syntax for an UPDATE LEFT JOIN query in > PostgreSQL. > > The equivalent MySQL query

[GENERAL] Update Join Query

2008-06-23 Thread Daniel Futerman
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