Re: How to add column from old_table to new_table?

Поиск
Список
Период
Сортировка
От Joost Kraaijeveld
Тема Re: How to add column from old_table to new_table?
Дата
Msg-id 1127307055.20038.25.camel@Panoramix
обсуждение исходный текст
Ответ на How to add column from old_table to new_table?  (Joost Kraaijeveld <J.Kraaijeveld@Askesis.nl>)
Ответы Re: How to add column from old_table to new_table?  (Gnanavel S <s.gnanavel@gmail.com>)
Список pgsql-sql
Hi,

I made a mistake in describing the query I tried. The query I tried was:

update new_table
set new_attribute = (select old_attribute from old_table, new_table
where old_table.id = new_table.id)
where old_table.id = new_table.id

It actually returns the error "ERROR:  more than one row returned by a
subquery used as an expression" if ran.


--
Groeten,

Joost Kraaijeveld
Askesis B.V.
Molukkenstraat 14
6524NB Nijmegen
tel: 024-3888063 / 06-51855277
fax: 024-3608416
e-mail: J.Kraaijeveld@Askesis.nl
web: www.askesis.nl






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

Предыдущее
От: Joost Kraaijeveld
Дата:
Сообщение: How to add column from old_table to new_table?
Следующее
От: "A. Kretschmer"
Дата:
Сообщение: Re: How to add column from old_table to new_table?