From: Tom Lane <tgl@sss.pgh.pa.us>
To: Frank Joerdens <frank@joerdens.de>
Cc: pgsql-sql@postgresql.org
Subject: Re: Subqueries in Non-SELECT Queries
Date: Sun, 17 Dec 2000 13:43:28 -0500
Message-ID: <21194.977078608@sss.pgh.pa.us> (raw)
In-Reply-To: <3A3CFFF9.3615E576@joerdens.de>
References: <3A3CFFF9.3615E576@joerdens.de>
Frank Joerdens <frank@joerdens.de> writes:
> 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.
Apparently the subquery "select id from index where level = 1" is
returning more than one row. Perhaps you want WHERE parentid IN subselect
rather than WHERE parentid = subselect. "=" is a scalar operator, not
a set operator.
regards, tom lane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-sql@postgresql.org
Cc: tgl@sss.pgh.pa.us, frank@joerdens.de
Subject: Re: Subqueries in Non-SELECT Queries
In-Reply-To: <21194.977078608@sss.pgh.pa.us>
References: <3A3CFFF9.3615E576@joerdens.de> <21194.977078608@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox