Re: SQL - update table problem...

Поиск
Список
Период
Сортировка
От Richard Huxton
Тема Re: SQL - update table problem...
Дата
Msg-id 455873CD.9020906@archonet.com
обсуждение исходный текст
Ответ на SQL - update table problem...  ("Marko Rihtar" <riki_fox@hotmail.com>)
Ответы Re: SQL - update table problem...  ("Shoaib Mir" <shoaibmir@gmail.com>)
Список pgsql-general
Marko Rihtar wrote:
> Hi,
>
> i'm trying to make update on multiple tables but don't know how.
> is something like this posible with postgresql?
>
> update table1
> join table2 on (table1.id=table2.t1)
> join table3 on (table2.id=table3.t2)
> set table1.name='test', table2.sum=table1.x+table2.y,
> table3.cell='123456789'
> where table1.id=6

I don't know of an SQL variant to handle this case. Usually people are
trying to update a single table based on joining to several others.

In your case you'll have to issue three update statements wrapped in a
transaction.

--
   Richard Huxton
   Archonet Ltd

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

Предыдущее
От: "Marko Rihtar"
Дата:
Сообщение: system tables...
Следующее
От: Richard Huxton
Дата:
Сообщение: Re: system tables...