Re: What is the syntax for UPDATE from one table to another?

Поиск
Список
Период
Сортировка
Искать
От
Jeff
Тема
Re: What is the syntax for UPDATE from one table to another?
Дата
Msg-id
D11EFA3F-7451-11D8-8474-000D9366F0C4@torgo.978.org
Ответ на
Список
Дерево обсуждения
What is the syntax for UPDATE from one table to another? pw <p.willis@telus.net>
Re: What is the syntax for UPDATE from one table to another? Bruno Wolff III <bruno@wolff.to>
Re: (THE_ANSWER) What is the syntax for UPDATE from one pw <p.willis@telus.net>
Re: What is the syntax for UPDATE from one table to another? Jeff <threshar@torgo.978.org>

On Mar 12, 2004, at 12:40 PM, pw wrote:

>
> Hello,
>
> What is the proper syntax for updating a column inone table from
> a column in another?
>
> I have tried this:
>
> UPDATE destination_table FROM source_table SET 
> destination_table.column_one = source_table.column_b WHERE constraint;
>

update destination_table set column_a = (select column_b from 
source_table where blah blah blah ) where blah blah blah

You can reference the values in destination_table inside the select.
--
Jeff Trout 
http://www.jefftrout.com/
http://www.stuarthamm.net/

В списке pgsql-general по дате отправления
От: Reece Hart
Дата:
От: Bruno Wolff III
Дата:
FAQ