Re: How to add column from old_table to new_table?

From: "Joost Kraaijeveld" <J(dot)Kraaijeveld(at)Askesis(dot)nl>
To: <Pgsql-sql(at)postgresql(dot)org>
Subject: Re: How to add column from old_table to new_table?
Date: 2005-09-21 12:50:55
Message-ID: 1127307055.20038.25.camel@Panoramix
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(dot)Kraaijeveld(at)Askesis(dot)nl
web: www.askesis.nl

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message A. Kretschmer 2005-09-21 12:56:25 Re: How to add column from old_table to new_table?
Previous Message Joost Kraaijeveld 2005-09-21 12:36:26 How to add column from old_table to new_table?