--- On Wed, 11/21/07, Andreas <[EMAIL PROTECTED]> 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 Things
WHERE Inventory.thing_fk = Things.thing_id
AND Things.color = 'red';
IIRC, Joe Celko referrers to this syntax as "T-SQL".
Regards,
Richard Broersma Jr.
---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
choose an index scan if your joining column's datatypes do not
match