On Sat, 16 Aug 2003, [iso-8859-1] Deepak Malhotra wrote:

> Hello
>
> Any idea why I am getting
> "ERROR:  More than one tuple returned by a subselect
> used as an expression"
> while running update statement using subselect
> statement.

That usually means you're using a subselect that returns
multiple rows in a context where a scalar is expected,
for example

update foo set bar = (select abc from def);

works if def has 0 rows (giving a NULL) or 1 row (giving a value),
but if the subselect returned say 3 rows, which gets used to
update each row from foo?



---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

               http://www.postgresql.org/docs/faqs/FAQ.html

Reply via email to