Received: from gl.aser.de (gl.aser.de [213.252.128.30]) by mail.postgresql.org (8.11.1/8.11.1) with ESMTP id eBHIUY615671 for ; Sun, 17 Dec 2000 13:30:34 -0500 (EST) (envelope-from gcg@gl.aser.de) Received: from pinguin (gcg@node84.dial.Uni-Magdeburg.DE [141.44.160.84]) by gl.aser.de (8.10.1/8.10.1) with SMTP id eBHIfpQ31609; Sun, 17 Dec 2000 19:41:51 +0100 Content-Type: text/plain; charset="iso-8859-1" From: Christof Glaser Organization: gl.aser software engineering . internet service To: Frank Joerdens , pgsql-sql@postgresql.org Subject: Re: Subqueries in Non-SELECT Queries Date: Sun, 17 Dec 2000 19:32:50 +0100 X-Mailer: KMail [version 1.2] References: <3A3CFFF9.3615E576@joerdens.de> In-Reply-To: <3A3CFFF9.3615E576@joerdens.de> MIME-Version: 1.0 Message-Id: <00121719325000.15220@pinguin> Content-Transfer-Encoding: 8bit X-Archive-Number: 200012/185 X-Sequence-Number: 519 Frank Joerdens wrote: > mpi=# update index set level = 2 where parentid = ( select id from > index where level = 1 ); > ERROR: More than one tuple returned by a subselect used as an > expression. mpi=# > > This is a recursive query, on a single table. Is that not possible? Hi Frank, as the error message says, the subselect must return only one value, since the where clause compares just one field for equality. You might try IN instead of =, ie update index set level = 2 where parentid in ( select id from index where level = 1 ); Hope that helps. Christof -- gl.aser . software engineering . internet service http://gl.aser.de/ . Planckstraße 7 . D-39104 Magdeburg Tel. +49.391.7 44 77 10 . Fax +49.391.7 44 77 13 . Mobil 0177.77 92 84 3