Re: Update Help

Поиск
Список
Период
Сортировка
От Peter Eisentraut
Тема Re: Update Help
Дата
Msg-id Pine.LNX.4.44.0209032035070.1157-100000@localhost.localdomain
обсуждение исходный текст
Ответ на Update Help  ("Yudie@axiontech.com" <yudie@axiontech.com>)
Список pgsql-sql
Yudie@axiontech.com writes:

> Let say I have 2 Product table, both of them has columns ProductID and
> Price What is the update command if I want to update all Prices of first
> table to be equal with Price in second table?

Possibly you mean something like this:

UPDATE first_table SET price = (SELECT price FROM second_table WHERE
second_table.productid = first_table.productid);

Possibly the answer is also to redesign your schema to avoid redundant
data.

-- 
Peter Eisentraut   peter_e@gmx.net



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

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: UPDATE & LIMIT together?
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Outer Join with For Update