Re: update on join ? - Mailing list pgsql-sql

From Richard Broersma Jr
Subject Re: update on join ?
Date
Msg-id 133720.79781.qm@web31807.mail.mud.yahoo.com
Whole thread Raw
In response to update on join ?  (Andreas <maps.on@gmx.net>)
List pgsql-sql
--- On Wed, 11/21/07, Andreas <maps.on@gmx.net> wrote:> 
> UPDATE inventory
> SET number = 0
> WHERE  thing_fk IN (SELECT thing_id FROM things WHERE color
> = 'red')

This is a perfectly acceptable ANSI-SQL update statement.

Here is non-ANSI update statement that you are probably after:

UPDATE Inventory  SET number = 0 FROM ThingsWHERE Inventory.thing_fk = Things.thing_id  AND Things.color = 'red';

IIRC, Joe Celko referrers to this syntax as "T-SQL".

Regards,
Richard Broersma Jr.


pgsql-sql by date:

Previous
From: Frank Bax
Date:
Subject: Re: update on join ?
Next
From: chester c young
Date:
Subject: Re: update on join ?