X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 9FE21D9771 for ; Wed, 21 Sep 2005 09:53:05 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 79123-09 for ; Wed, 21 Sep 2005 12:52:59 +0000 (GMT) Received: from obelix.askesis.nl (laudanum.demon.nl [82.161.125.16]) by svr1.postgresql.org (Postfix) with ESMTP id 5D5D2D72AB for ; Wed, 21 Sep 2005 09:53:00 -0300 (ADT) Received: obelix.askesis.nl 172.31.0.1 from 172.31.1.8 172.31.1.8 via HTTP with MS-WebStorage 6.0.6249 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-MimeOLE: Produced By Microsoft Exchange V6.0.6487.1 Received: from Panoramix by obelix.askesis.nl; 21 Sep 2005 14:50:55 +0200 In-Reply-To: <1127306186.20038.21.camel@Panoramix> References: <1127306186.20038.21.camel@Panoramix> X-Mailer: Evolution 2.0.4 content-class: urn:content-classes:message Subject: Re: How to add column from old_table to new_table? Date: Wed, 21 Sep 2005 14:50:55 +0200 Message-ID: <1127307055.20038.25.camel@Panoramix> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [SQL] How to add column from old_table to new_table? thread-index: AcW+qxsQpmVx3maOTAauVHmLlMhGzg== From: "Joost Kraaijeveld" To: X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.09 required=5 tests=[AWL=0.040, FORGED_RCVD_HELO=0.05] X-Spam-Level: X-Archive-Number: 200509/179 X-Sequence-Number: 22726 Hi, I made a mistake in describing the query I tried. The query I tried was: update new_table=20 set new_attribute =3D (select old_attribute from old_table, new_table where old_table.id =3D new_table.id) where old_table.id =3D new_table.id It actually returns the error "ERROR: more than one row returned by a subquery used as an expression" if ran. --=20 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=20