Re: update on join ?

Поиск
Список
Период
Сортировка
От chester c young
Тема Re: update on join ?
Дата
Msg-id 169536.38344.qm@web54304.mail.re2.yahoo.com
обсуждение исходный текст
Ответ на update on join ?  (Andreas <maps.on@gmx.net>)
Список pgsql-sql
> I tried
> 
> UPDATE  things JOIN inventory ON things.thing_id = inventory.thing_fk
> SET number = 0
> WHERE color = 'red'
> 

use the cool "from" clause in the update

update things tset number = 0
from inventory i
where t.thing_id = i.thing_fk
and i.color = 'red';



     ____________________________________________________________________________________
Get easy, one-click access to your favorites. 
Make Yahoo! your homepage.
http://www.yahoo.com/r/hs 


В списке pgsql-sql по дате отправления:

Предыдущее
От: Richard Broersma Jr
Дата:
Сообщение: Re: update on join ?
Следующее
От: Richard Broersma Jr
Дата:
Сообщение: Bad Schema Design or Useful Trick?