Re: update on join ?

Поиск
Список
Период
Сортировка
От Richard Broersma Jr
Тема Re: update on join ?
Дата
Msg-id 133720.79781.qm@web31807.mail.mud.yahoo.com
обсуждение исходный текст
Ответ на update on join ?  (Andreas <maps.on@gmx.net>)
Список 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 по дате отправления:

Предыдущее
От: Frank Bax
Дата:
Сообщение: Re: update on join ?
Следующее
От: chester c young
Дата:
Сообщение: Re: update on join ?