Re: trivial sql help

From: Joe Conway <mail(at)joeconway(dot)com>
To: Patrick Welche <prlw1(at)newn(dot)cam(dot)ac(dot)uk>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: trivial sql help
Date: 2002-10-10 16:12:28
Message-ID: 3DA5A6EC.9040906@joeconway.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Patrick Welche wrote:
> 333 | 1
> (18 rows)
>
> update rawrequest
> set cid=(

> select pc.c
> from pers_comp as pc
> where pc.p=pid
> group by pc.c
> having count(pc.c)=1
> )
> where pr
> ;
>
> ERROR: More than one tuple returned by a subselect used as an expression.

Well, the same query above *does* return more than one row (18 in fact). I
think you need to qualify the sub-select a bit more, but without more details
on your schema, it is hard to guess how.

Joe

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Stephan Szabo 2002-10-10 16:14:41 Re: trivial sql help
Previous Message Erwan DUROSELLE 2002-10-10 15:58:01 Rép. : Re: access time performance problem